This method retrieves the list of System functions supported by the current database. The names returned by this method are the Open CLI System function names.
This method returns a String value holding the list of functions separated by commas (",").
To get the list of the System functions supported by the underlying database −
Finally, get the list of System functions supported by the underlying database, by invoking the getSystemFunctions() method of the DatabaseMetaData class.
Following JDBC program establishes connection with MySQL database and, retrieves the list of system functions supported by the underlying database.
import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.DriverManager; import java.sql.SQLException; import java.util.StringTokenizer; public class DatabaseMetadata_getSystemFunctions { public static void main(String args[]) throws SQLException { //Registering the Driver DriverManager.registerDriver(new com.mysql.jdbc.Driver()); //Getting the connection String url = "jdbc:mysql://localhost/mydatabase"; Connection con = DriverManager.getConnection(url, "root", "password"); System.out.println("Connection established......"); //Retrieving the meta data object DatabaseMetaData metaData = con.getMetaData(); //Retrieving the list of system functions String numeric_functions = metaData.getSystemFunctions(); StringTokenizer tokenizer = new StringTokenizer(numeric_functions, ","); while(tokenizer.hasMoreElements()) { System.out.println(tokenizer.nextToken()); } System.out.println(" "); } }
Connection established...... DATABASE USER SYSTEM_USER SESSION_USER PASSWORD ENCRYPT LAST_INSERT_ID VERSION