FileDocCategorySizeDatePackage
SupportedScalarFunctions.javaAPI DocExample1552Thu Jun 14 17:53:14 BST 2001None

SupportedScalarFunctions.java

import java.io.*;
import java.sql.*;

public class SupportedScalarFunctions {
  Connection conn;

  public SupportedScalarFunctions() {
    try {
      DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
      conn = DriverManager.getConnection(
       "jdbc:oracle:thin:@dssw2k01:1521:orcl", "scott", "tiger");
    }
    catch (SQLException e) {
      System.err.println(e.getMessage());
      e.printStackTrace();
    }
  }

  public static void main(String[] args) 
   throws Exception, IOException {
    SupportedScalarFunctions ssf = new SupportedScalarFunctions();

    ssf.process();  
  }

  public void process() throws IOException, SQLException {
    DatabaseMetaData dmd = null;
    try {
      dmd = conn.getMetaData();
      System.out.println("NUMERIC FUNCTIONS: ");
      System.out.println(dmd.getNumericFunctions());
      System.out.println(" ");
      System.out.println("STRING FUNCTIONS: ");
      System.out.println(dmd.getStringFunctions());
      System.out.println(" ");
      System.out.println("SYSTEM FUNCTIONS: ");
      System.out.println(dmd.getSystemFunctions());
      System.out.println(" ");
      System.out.println("TIME & DATE FUNCTIONS: ");
      System.out.println(dmd.getTimeDateFunctions());
    }
    catch (SQLException e) {
      System.err.println(e.getMessage());
    }
  }

  protected void finalize() 
   throws Throwable {
    if (conn != null) 
      try { conn.close(); } catch (SQLException ignore) { }
    super.finalize();
  }
}