Listing the Time and Date Functions Supported by a Database : Metadata DB Info « Database SQL JDBC « Java






Listing the Time and Date Functions Supported by a Database

   
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.util.Arrays;

public class Main {
  public static void main(String[] argv) throws Exception {
    String driverName = "com.jnetdirect.jsql.JSQLDriver";
    Class.forName(driverName);

    String serverName = "127.0.0.1";
    String portNumber = "1433";
    String mydatabase = serverName + ":" + portNumber;
    String url = "jdbc:JSQLConnect://" + mydatabase;
    String username = "username";
    String password = "password";

    Connection connection = DriverManager.getConnection(url, username, password);
    DatabaseMetaData dbmd = connection.getMetaData();

    // Get the list of time and date functions
    String timedateFunctions[] = dbmd.getTimeDateFunctions().split(",\\s*");
    Arrays.toString(timedateFunctions);

  }
}

   
    
    
  








Related examples in the same category

1.Get all key words in database
2.Get Database Schema From MetaData
3.Get Catalog From Database Metadata
4.Is statement pooling supported?
5.Database MetaData: Database version
6.Type info in database metadata
7.A database MetaData query
8.DatabaseMetaData class to obtain information about the
9.Database Info
10.JDBC Performance
11.Driver Property Info
12.If database support transaction
13.If database support scrollable result sets
14.Get database product information
15.Get data types supported by database
16.If database support batch update
17.Get database maximum table name length
18.Get numeric functions supported by database
19.Get JDBC driver information
20.Get system functions supported by database?
21.Get the max concurrent connection to a database?
22.Get date time functions supported by database
23.Get column names of a table using ResultSetMetaData
24.Get column's precision and scale value?
25.Get string functions supported by database?
26.JDBC Version App
27.Listing All Non-SQL92 Keywords Used by a Database
28.Listing the String Functions Supported by a Database: retrieves a list of string functions that a database supports.
29.Listing the Numeric Functions Supported by a Database
30.Listing the System Functions Supported by a Database
31.Getting the Maximum Table Name Length allowed in a Database
32.Detect if a table exists
33.This program uses metadata to display arbitrary tables in a database.