Java Reference
In-Depth Information
Connection con = DriverManager.getConnection ("jdbc:odbc:Customers");
DatabaseMetaData dbmd = con.getMetaData();
ResultSet rs = dbmd.getTables(null,null,"%",new String[]{"TABLE"});
General information about the underlying database is accessible from the
DatabaseMetaData interface by using methods such as these:
getURL()
getUserName()
getDatabaseProductName()
getSQLKeywords()
nullsAreSortedHigh() and nullsAreSortedLow()
Useful methods for retrieving information about supported functionality include the
following:
supportsBatchUpdates()
supportsStoredProcedures()
supportsFullOuterJoins()
supportsPositionedDelete()
These methods are provided to determine limits the database imposes:
getMaxRowSize()
getMaxStatementLength()
getMaxConnections()
getMaxColumnsInTable()
Useful methods for retrieving information about SQL objects and their attributes
include the following:
getSchemas()
getCatalogs()
getTables()
getPrimaryKeys()
getProcedures()
The transaction-support capabilities of the database management system can be
queried using these methods:
supportsMultipleTransactions()
getDefaultTransactionIsolation()
supportsSavePoints()
Many of the DatabaseMetaData methods have been added or modified in
JDBC 2.0 and JDBC 3.0, so if your driver is not JDBC 2.0 or JDBC 3.0
Note