Listing the Time and Date Functions Supported by a Database - Java JDBC

Java examples for JDBC:Database Meta Data

Description

Listing the Time and Date Functions Supported by a Database

Demo Code


import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;

public class Main {
  public static void main(String[] argv) {
    try {//from   w w w .j  ava  2  s .  com
      Connection connection = null;
      DatabaseMetaData dbmd = connection.getMetaData();

      // Get the list of time and date functions
      String timedateFunctions[] = dbmd.getTimeDateFunctions().split(",\\s*");
    } catch (SQLException e) {
    }
  }
}

Related Tutorials