Demos and Usage of java.sql.Connection.getMetaData()


   1:     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 
   2:     Connection c = 
   3:       DriverManager.getConnection("jdbc:odbc:Kurse");
   4:         ...
   5:       DatabaseMetaData meta = c.getMetaData();
   6:       System.out.println(meta.getDatabaseProductName() + " " 
   7:                        + meta.getDatabaseProductVersion() );
   8:       System.out.println("Supports UNION: " + meta.supportsUnion());

View Full Code Here
   1:     Class.forName("oracle.jdbc.driver.OracleDriver"); 
   2:     Connection c = DriverManager.getConnection(
   3:                     "jdbc:oracle:thin:@p30:1521:jdbcbuch", "system","manager");
   4:         ...
   5:     DatabaseMetaData meta = c.getMetaData();
   6:     System.out.println(meta.getDatabaseProductName() + " " 
   7:                                        + meta.getDatabaseProductVersion() );
   8:     System.out.println("Entry Level  " + meta.supportsANSI92EntryLevelSQL());

View Full Code Here
   1:     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 
   2:     Connection c = DriverManager.getConnection("jdbc:odbc:Kurse");
   3:         ...
   4:     DatabaseMetaData meta = c.getMetaData();
   5:     System.out.println(meta.getDatabaseProductName() + " " +
   6:                                          meta.getDatabaseProductVersion());
   7:     System.out.println("Entry Level  " + meta.supportsANSI92EntryLevelSQL());

View Full Code Here
   1:     Class.forName("oracle.jdbc.driver.OracleDriver");
   2:     Connection c = DriverManager.getConnection(
   3:             "jdbc:oracle:thin:@p30:1521:jdbcbuch", "system", "manager");
   4:         ...
   5:     DatabaseMetaData meta = c.getMetaData();
   6:     System.out.println(meta.getDatabaseProductName() + " " +
   7:                        meta.getDatabaseProductVersion() );
   8:     System.out.println("Stored Procedures: " + meta.supportsStoredProcedures() );

View Full Code Here
   1:   public static void main(String[] args)throws SQLException{  
   2:     Connection con=new ConnectionProvider().getConnection();
   3:         ...
   4:     DatabaseMetaData metaData=con.getMetaData();
   5:     System.out.println("��������l����Ϊ:"+metaData.getMaxConnections());
   6:     System.out.println("һ��l������ͬʱ�򿪵�Statement�������ĿΪ:"+metaData.getMaxStatements());
   7:   

View Full Code Here
   1:     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 
   2:     Connection c =  DriverManager.getConnection("jdbc:odbc:Kurse");
   3:         ...
   4:     DatabaseMetaData dbmd = c.getMetaData();
   5:     System.out.println(dbmd.getDatabaseProductName() + " " 
   6:                         + dbmd.getDatabaseProductVersion() );
   7:     System.out.println("Numerische Funktionen\n" +   dbmd.getNumericFunctions());

View Full Code Here
   1:   public static void main(String[] args) {
   2:     Connection conn = null;
   3:     ResultSet rset = null;
   4:         ...
   5:       conn = ConnectionFactory.getConnection();
   6:       DatabaseMetaData dbmd = conn.getMetaData();
   7: 
   8:       String[] types = {
   9:         "TABLE"

View Full Code Here
   1:       {
   2:           Connection con;
   3:           con = DriverManager.getConnection (args [0]);
   4:         ...
   5: 
   6:           DatabaseMetaData dbmd = con.getMetaData();
   7:           ResultSet rs = dbmd.getSchemas ();
   8:         ...
   9: 
  10:           if (con.getMetaData().getDriverName ().equals ("Apache Derby "+
  11:               "Embedded JDBC Driver"))

View Full Code Here
   1:     Class.forName( DRIVER );
   2:     Connection con = DriverManager.getConnection( URL, USER, PASS );
   3: 
   4:         ...
   5:     DatabaseMetaData meta = con.getMetaData();
   6:     
   7:     System.out.println( "ProduktnameDatabase: " +
   8:                          meta.getDatabaseProductName() );

View Full Code Here
   1:       {
   2:           Connection con;
   3:           con = DriverManager.getConnection (args [0]);
   4:         ...
   5: 
   6:           DatabaseMetaData dbmd = con.getMetaData();
   7:           if (dbmd.getRowIdLifetime () != RowIdLifetime.ROWID_UNSUPPORTED)
   8:         ...
   9: 
  10:           if (con.getMetaData().getDriverName ().equals ("Apache Derby "+
  11:               "Embedded JDBC Driver"))

View Full Code Here
   1:     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); 
   2:     Connection c = DriverManager.getConnection("jdbc:odbc:Kurse");
   3:         ...
   4:     DatabaseMetaData dbmd = c.getMetaData();
   5:     System.out.println(dbmd.getDatabaseProductName() + " " 
   6:                                         + dbmd.getDatabaseProductVersion());
   7:     System.out.println("Transaktionen " + dbmd.supportsTransactions());

View Full Code Here
   1: import java.sql.Connection;
   2: import java.sql.SQLException;
   3:         ...
   4: 
   5:     public static boolean supportsTransactions(Connection conn)
   6:         throws SQLException {
   7:         ...
   8: 
   9:         DatabaseMetaData dbMetaData = conn.getMetaData();
  10:         if (dbMetaData == null) {
  11:         ...
  12:     public static void main(String[] args) {
  13:         Connection conn = null;

View Full Code Here
   1:       {
   2:           Connection con;
   3:           con = DriverManager.getConnection (args [0]);
   4:         ...
   5: 
   6:           DatabaseMetaData dbmd = con.getMetaData();
   7:           ResultSet rs = dbmd.getTypeInfo ();
   8:         ...
   9: 
  10:           if (con.getMetaData().getDriverName ().equals ("Apache Derby "+
  11:               "Embedded JDBC Driver"))

View Full Code Here
   1: 
   2:       Connection con = DriverManager.getConnection (args [0]);
   3: 
   4:         ...
   5: 
   6:       if (con.getMetaData().getDriverName ().equals ("Apache Derby "+
   7:           "Embedded JDBC Driver"))
   8:         ...
   9: 
  10:    static boolean isSupported (Connection con, String func) throws SQLException
  11:    {
  12:         ...
  13:       DatabaseMetaData dbmd = con.getMetaData();

View Full Code Here
   1: import java.util.HashMap;
   2: import java.sql.Connection;
   3: import java.sql.DatabaseMetaData;
   4:         ...
   5: 
   6:     public static DatabaseSpecifics getDatabaseSpecifics(Connection conn) throws Exception {
   7:         ...
   8:         DatabaseMetaData dbMeataData = conn.getMetaData();
   9:         String dbProductName = dbMeataData.getDatabaseProductName();

View Full Code Here