DatabaseMetaData

public interface DatabaseMetaData implements Wrapper

Comprehensive information about the database as a whole.

This interface is implemented by driver vendors to let users know the capabilities of a Database Management System (DBMS) in combination with the driver based on JDBCTM technology ("JDBC driver") that is used with it. Different relational DBMSs often support different features, implement features in different ways, and use different data types. In addition, a driver may implement a feature on top of what the DBMS offers. Information returned by methods in this interface applies to the capabilities of a particular driver and a particular DBMS working together. Note that as used in this documentation, the term "database" is used generically to refer to both the driver and DBMS.

A user for this interface is commonly a tool that needs to discover how to deal with the underlying DBMS. This is especially true for applications that are intended to be used with more than one DBMS. For example, a tool might use the method getTypeInfo to find out what data types can be used in a CREATE TABLE statement. Or a user might call the method supportsCorrelatedSubqueries to see if it is possible to use a correlated subquery or supportsBatchUpdates to see if it is possible to use batch updates.

Some DatabaseMetaData methods return lists of information in the form of ResultSet objects. Regular ResultSet methods, such as getString and getInt, can be used to retrieve the data from these ResultSet objects. If a given form of metadata is not available, an empty ResultSet will be returned. Additional columns beyond the columns defined to be returned by the ResultSet object for a given method can be defined by the JDBC driver vendor and must be accessed by their column label.

Some DatabaseMetaData methods take arguments that are String patterns. These arguments all have names such as fooPattern. Within a pattern String, "%" means match any substring of 0 or more characters, and "_" means match any one character. Only metadata entries matching the search pattern are returned. If a search pattern argument is set to null, that argument's criterion will be dropped from the search.

Constant Summary

short attributeNoNulls Indicates that NULL values might not be allowed.
short attributeNullable Indicates that NULL values are definitely allowed.
short attributeNullableUnknown Indicates that whether NULL values are allowed is not known.
int bestRowNotPseudo Indicates that the best row identifier is NOT a pseudo column.
int bestRowPseudo Indicates that the best row identifier is a pseudo column.
int bestRowSession Indicates that the scope of the best row identifier is the remainder of the current session.
int bestRowTemporary Indicates that the scope of the best row identifier is very temporary, lasting only while the row is being used.
int bestRowTransaction Indicates that the scope of the best row identifier is the remainder of the current transaction.
int bestRowUnknown Indicates that the best row identifier may or may not be a pseudo column.
int columnNoNulls Indicates that the column might not allow NULL values.
int columnNullable Indicates that the column definitely allows NULL values.
int columnNullableUnknown Indicates that the nullability of columns is unknown.
int functionColumnIn Indicates that the parameter or column is an IN parameter.
int functionColumnInOut Indicates that the parameter or column is an INOUT parameter.
int functionColumnOut Indicates that the parameter or column is an OUT parameter.
int functionColumnResult Indicates that the parameter or column is a column in a result set.
int functionColumnUnknown Indicates that type of the parameter or column is unknown.
int functionNoNulls Indicates that NULL values are not allowed.
int functionNoTable Indicates that the function does not return a table.
int functionNullable Indicates that NULL values are allowed.
int functionNullableUnknown Indicates that whether NULL values are allowed is unknown.
int functionResultUnknown Indicates that it is not known whether the function returns a result or a table.
int functionReturn Indicates that the parameter or column is a return value.
int functionReturnsTable Indicates that the function returns a table.
int importedKeyCascade For the column UPDATE_RULE, indicates that when the primary key is updated, the foreign key (imported key) is changed to agree with it.
int importedKeyInitiallyDeferred Indicates deferrability.
int importedKeyInitiallyImmediate Indicates deferrability.
int importedKeyNoAction For the columns UPDATE_RULE and DELETE_RULE, indicates that if the primary key has been imported, it cannot be updated or deleted.
int importedKeyNotDeferrable Indicates deferrability.
int importedKeyRestrict For the column UPDATE_RULE, indicates that a primary key may not be updated if it has been imported by another table as a foreign key.
int importedKeySetDefault For the columns UPDATE_RULE and DELETE_RULE, indicates that if the primary key is updated or deleted, the foreign key (imported key) is set to the default value.
int importedKeySetNull For the columns UPDATE_RULE and DELETE_RULE, indicates that when the primary key is updated or deleted, the foreign key (imported key) is changed to NULL.
int procedureColumnIn Indicates that the column stores IN parameters.
int procedureColumnInOut Indicates that the column stores INOUT parameters.
int procedureColumnOut Indicates that the column stores OUT parameters.
int procedureColumnResult Indicates that the column stores results.
int procedureColumnReturn Indicates that the column stores return values.
int procedureColumnUnknown Indicates that type of the column is unknown.
int procedureNoNulls Indicates that NULL values are not allowed.
int procedureNoResult Indicates that the procedure does not return a result.
int procedureNullable Indicates that NULL values are allowed.
int procedureNullableUnknown Indicates that whether NULL values are allowed is unknown.
int procedureResultUnknown Indicates that it is not known whether the procedure returns a result.
int procedureReturnsResult Indicates that the procedure returns a result.
int sqlStateSQL A possible return value for the method DatabaseMetaData.getSQLStateType which is used to indicate whether the value returned by the method SQLException.getSQLState is an SQLSTATE value.
int sqlStateSQL99 A possible return value for the method DatabaseMetaData.getSQLStateType which is used to indicate whether the value returned by the method SQLException.getSQLState is an SQL99 SQLSTATE value.
int sqlStateXOpen A possible return value for the method DatabaseMetaData.getSQLStateType which is used to indicate whether the value returned by the method SQLException.getSQLState is an X/Open (now know as Open Group) SQL CLI SQLSTATE value.
short tableIndexClustered Indicates that this table index is a clustered index.
short tableIndexHashed Indicates that this table index is a hashed index.
short tableIndexOther Indicates that this table index is not a clustered index, a hashed index, or table statistics; it is something other than these.
short tableIndexStatistic Indicates that this column contains table statistics that are returned in conjunction with a table's index descriptions.
int typeNoNulls Indicates that a NULL value is NOT allowed for this data type.
int typeNullable Indicates that a NULL value is allowed for this data type.
int typeNullableUnknown Indicates that it is not known whether a NULL value is allowed for this data type.
int typePredBasic Indicates that the data type can be only be used in WHERE search clauses that do not use LIKE predicates.
int typePredChar Indicates that the data type can be only be used in WHERE search clauses that use LIKE predicates.
int typePredNone Indicates that WHERE search clauses are not supported for this type.
int typeSearchable Indicates that all WHERE search clauses can be based on this type.
int versionColumnNotPseudo Indicates that this version column is NOT a pseudo column.
int versionColumnPseudo Indicates that this version column is a pseudo column.
int versionColumnUnknown Indicates that this version column may or may not be a pseudo column.

Public Method Summary

abstract boolean
allProceduresAreCallable()
Retrieves whether the current user can call all the procedures returned by the method getProcedures.
abstract boolean
allTablesAreSelectable()
Retrieves whether the current user can use all the tables returned by the method getTables in a SELECT statement.
abstract boolean
autoCommitFailureClosesAllResultSets()
Retrieves whether a SQLException while autoCommit is true inidcates that all open ResultSets are closed, even ones that are holdable.
abstract boolean
dataDefinitionCausesTransactionCommit()
Retrieves whether a data definition statement within a transaction forces the transaction to commit.
abstract boolean