All Implemented Interfaces:
Wrapper
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.
| Field Summary | ||
|---|---|---|
| int | procedureResultUnknown | Indicates that it is not known whether the procedure returns
a result.
A possible value for column |
| int | procedureNoResult | Indicates that the procedure does not return a result.
A possible value for column |
| int | procedureReturnsResult | Indicates that the procedure returns a result.
A possible value for column |
| int | procedureColumnUnknown | Indicates that type of the column is unknown.
A possible value for the column
|
| int | procedureColumnIn | Indicates that the column stores IN parameters.
A possible value for the column
|
| int | procedureColumnInOut | Indicates that the column stores INOUT parameters.
A possible value for the column
|
| int | procedureColumnOut | Indicates that the column stores OUT parameters.
A possible value for the column
|
| int | procedureColumnReturn | Indicates that the column stores return values.
A possible value for the column
|
| int | procedureColumnResult | Indicates that the column stores results.
A possible value for the column
|
| int | procedureNoNulls | Indicates that NULL values are not allowed.
A possible value for the column
|
| int | procedureNullable | Indicates that NULL values are allowed.
A possible value for the column
|
| int | procedureNullableUnknown | Indicates that whether NULL values are allowed
is unknown.
A possible value for the column
|
| int | columnNoNulls | Indicates that the column might not allow NULL values.
A possible value for the column
|
| int | columnNullable | Indicates that the column definitely allows NULL values.
A possible value for the column
|
| int | columnNullableUnknown | Indicates that the nullability of columns is unknown.
A possible value for the column
|
| int | bestRowTemporary | Indicates that the scope of the best row identifier is
very temporary, lasting only while the
row is being used.
A possible value for the column
|
| int | bestRowTransaction | Indicates that the scope of the best row identifier is
the remainder of the current transaction.
A possible value for the column
|
| int | bestRowSession | Indicates that the scope of the best row identifier is
the remainder of the current session.
A possible value for the column
|
| int | bestRowUnknown | Indicates that the best row identifier may or may not be a pseudo column.
A possible value for the column
|
| int | bestRowNotPseudo | Indicates that the best row identifier is NOT a pseudo column.
A possible value for the column
|
| int | bestRowPseudo | Indicates that the best row identifier is a pseudo column.
A possible value for the column
|
| int | versionColumnUnknown | Indicates that this version column may or may not be a pseudo column.
A possible value for the column
|
| int | versionColumnNotPseudo | Indicates that this version column is NOT a pseudo column.
A possible value for the column
|
| int | versionColumnPseudo | Indicates that this version column is a pseudo column.
A possible value for the column
|
| 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.
For the column DELETE_RULE,
it indicates that
when the primary key is deleted, rows that imported that key
are deleted.
A possible value for the columns |
| 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.
For the column DELETE_RULE, indicates that
a primary key may not be deleted if it has been imported by
another table as a foreign key.
A possible value for the columns |
| 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.
A possible value for the columns |
| 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.
A possible value for the columns |
| 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.
A possible value for the columns |
| int | importedKeyInitiallyDeferred | Indicates deferrability. See SQL-92 for a definition.
A possible value for the column |
| int | importedKeyInitiallyImmediate | Indicates deferrability. See SQL-92 for a definition.
A possible value for the column |
| int | importedKeyNotDeferrable | Indicates deferrability. See SQL-92 for a definition.
A possible value for the column |
| int | typeNoNulls | Indicates that a NULL value is NOT allowed for this
data type.
A possible value for column |
| int | typeNullable | Indicates that a NULL value is allowed for this
data type.
A possible value for column |
| int | typeNullableUnknown | Indicates that it is not known whether a NULL value
is allowed for this data type.
A possible value for column |
| int | typePredNone | Indicates that WHERE search clauses are not supported
for this type.
A possible value for column |
| int | typePredChar | Indicates that the data type
can be only be used in WHERE search clauses
that use LIKE predicates.
A possible value for column |
| int | typePredBasic | Indicates that the data type can be only be used in WHERE
search clauses
that do not use LIKE predicates.
A possible value for column |
| int | typeSearchable | Indicates that all WHERE search clauses can be
based on this type.
A possible value for column |
| short | tableIndexStatistic | Indicates that this column contains table statistics that
are returned in conjunction with a table's index descriptions.
A possible value for column |
| short | tableIndexClustered | Indicates that this table index is a clustered index.
A possible value for column |
| short | tableIndexHashed | Indicates that this table index is a hashed index.
A possible value for column |
| short | tableIndexOther | Indicates that this table index is not a clustered
index, a hashed index, or table statistics;
it is something other than these.
A possible value for column |
| short | attributeNoNulls | Indicates that NULL values might not be allowed.
A possible value for the column
|
| short | attributeNullable | Indicates that NULL values are definitely allowed.
A possible value for the column |
| short | attributeNullableUnknown | Indicates that whether NULL values are allowed is not
known.
A possible value for the column |
| 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.
|
| 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.
Note:This constant remains only for compatibility reasons. Developers
should use the constant
|
| int | functionColumnUnknown | Indicates that type of the parameter or column is unknown.
A possible value for the column
|
| int | functionColumnIn | Indicates that the parameter or column is an IN parameter.
A possible value for the column
|
| int | functionColumnInOut | Indicates that the parameter or column is an INOUT parameter.
A possible value for the column
|
| int | functionColumnOut | Indicates that the parameter or column is an OUT parameter.
A possible value for the column
|
| int | functionReturn | Indicates that the parameter or column is a return value.
A possible value for the column
|
| int | functionColumnResult | Indicates that the parameter or column is a column in a result set.
A possible value for the column
|
| int | functionNoNulls | Indicates that NULL values are not allowed.
A possible value for the column
|
| int | functionNullable | Indicates that NULL values are allowed.
A possible value for the column
|
| int | functionNullableUnknown | Indicates that whether NULL values are allowed
is unknown.
A possible value for the column
|
| int | functionResultUnknown | Indicates that it is not known whether the function returns
a result or a table.
A possible value for column
|
| int | functionNoTable | Indicates that the function does not return a table.
A possible value for column
|
| int | functionReturnsTable | Indicates that the function returns a table.
A possible value for column
|
| Method from java.sql.DatabaseMetaData Detail: |
|---|
getProcedures. |
getTables in a SELECT
statement. |
SQLException while autoCommit is true inidcates
that all open ResultSets are closed, even ones that are holdable. When a SQLException occurs while
autocommit is true, it is vendor specific whether the JDBC driver responds with a commit operation, a
rollback operation, or by doing neither a commit nor a rollback. A potential result of this difference
is in whether or not holdable ResultSets are closed. |
|
|
ResultSet.rowDeleted. If the method
deletesAreDetected returns false, it means that
deleted rows are removed from the result set. |
getMaxRowSize includes the SQL data types
LONGVARCHAR and LONGVARBINARY. |
Descriptions are returned only for attributes of UDTs matching the
catalog, schema, type, and attribute name criteria. They are ordered by
The |
Each column description has the following columns: The COLUMN_SIZE column represents the specified column size for the given column. For numeric data, this is the maximum precision. For character data, this is the length in characters. For datetime datatypes, this is the length in characters of the String representation (assuming the maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype, this is the length in bytes. Null is returned for data types where the column size is not applicable. |
String that this database uses as the
separator between a catalog and table name. |
|
The catalog column is: |
The |
Only privileges matching the column name criteria are returned. They are ordered by COLUMN_NAME and PRIVILEGE. Each privilige description has the following columns: |
Only column descriptions matching the catalog, schema, table
and column name criteria are returned. They are ordered by
Each column description has the following columns: The COLUMN_SIZE column the specified column size for the given column. For numeric data, this is the maximum precision. For character data, this is the length in characters. For datetime datatypes, this is the length in characters of the String representation (assuming the maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype, this is the length in bytes. Null is returned for data types where the column size is not applicable. |
|
Each foreign key column description has the following columns: |
|
|
|
|
java.sql.Connection. |
|
|
|
String. |
Each foreign key column description has the following columns: |
|
Only descriptions matching the schema, function and
parameter name criteria are returned. They are ordered by
Each row in the The PRECISION column represents the specified column size for the given parameter or column. For numeric data, this is the maximum precision. For character data, this is the length in characters. For datetime datatypes, this is the length in characters of the String representation (assuming the maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype, this is the length in bytes. Null is returned for data types where the column size is not applicable. |
Only system and user function descriptions matching the schema and
function name criteria are returned. They are ordered by
Each function description has the the following columns:
A user may not have permission to execute any of the functions that are
returned by |
|
Each primary key column description has the following columns: |
Each index column description has the following columns: |
|
|
|
|
|
|
GROUP BY clause. |
|
ORDER BY clause. |
SELECT list. |
|
|
|
|
|
|
|
|
|
|
SELECT statement. |
|
|
Each primary key column description has the following columns: |
Only descriptions matching the schema, procedure and parameter name criteria are returned. They are ordered by PROCEDURE_CAT, PROCEDURE_SCHEM, PROCEDURE_NAME and SPECIFIC_NAME. Within this, the return value, if any, is first. Next are the parameter descriptions in call order. The column descriptions follow in column number order. Each row in the Note: Some databases may not return the column descriptions for a procedure. The PRECISION column represents the specified column size for the given column. For numeric data, this is the maximum precision. For character data, this is the length in characters. For datetime datatypes, this is the length in characters of the String representation (assuming the maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype, this is the length in bytes. Null is returned for data types where the column size is not applicable. |
|
Only procedure descriptions matching the schema and
procedure name criteria are returned. They are ordered by
Each procedure description has the the following columns:
A user may not have permissions to execute any of the procedures that are
returned by |
ResultSet
objects. |
ROWID type,
and if so the lifetime for which a RowId object remains valid.
The returned int values have the following relationship: ROWID_UNSUPPORTED < ROWID_VALID_OTHER < ROWID_VALID_TRANSACTION < ROWID_VALID_SESSION < ROWID_VALID_FOREVERso conditional logic such as if (metadata.getRowIdLifetime() > DatabaseMetaData.ROWID_VALID_TRANSACTION)can be used. Valid Forever means valid across all Sessions, and valid for a Session means valid across all its contained Transactions. |
|
SQLException.getSQLState
is X/Open (now known as Open Group) SQL CLI or SQL:2003. |
|
TABLE_CATALOG and
TABLE_SCHEM.
The schema columns are: |
TABLE_CATALOG and
TABLE_SCHEM.
The schema columns are: |
The '_' character represents any single character; the '%' character represents any sequence of zero or more characters. |
|
Only supertable information for tables matching the catalog, schema and table name are returned. The table name parameter may be a fully- qualified name, in which case, the catalog and schemaPattern parameters are ignored. If a table does not have a super table, it is not listed here. Supertables have to be defined in the same catalog and schema as the sub tables. Therefore, the type description does not need to include this information for the supertable. Each type description has the following columns: Note: If the driver does not support type hierarchies, an empty result set is returned. |
Only supertype information for UDTs matching the catalog, schema, and type name is returned. The type name parameter may be a fully-qualified name. When the UDT name supplied is a fully-qualified name, the catalog and schemaPattern parameters are ignored.
If a UDT does not have a direct super type, it is not listed here.
A row of the Note: If the driver does not support type hierarchies, an empty result set is returned. |
|
Only privileges matching the schema and table name
criteria are returned. They are ordered by
Each privilige description has the following columns: |
The table type is: |
TABLE_TYPE, TABLE_CAT,
TABLE_SCHEM and TABLE_NAME.
Each table description has the following columns: Note: Some databases may not return information for all tables. |
|
If the database supports SQL distinct types, then getTypeInfo() will return a single row with a TYPE_NAME of DISTINCT and a DATA_TYPE of Types.DISTINCT. If the database supports SQL structured types, then getTypeInfo() will return a single row with a TYPE_NAME of STRUCT and a DATA_TYPE of Types.STRUCT. If SQL distinct or structured types are supported, then information on the individual types may be obtained from the getUDTs() method. Each type description has the following columns: The PRECISION column represents the maximum column size that the server supports for the given datatype. For numeric data, this is the maximum precision. For character data, this is the length in characters. For datetime datatypes, this is the length in characters of the String representation (assuming the maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype, this is the length in bytes. Null is returned for data types where the column size is not applicable. |
JAVA_OBJECT, STRUCT,
or DISTINCT.
Only types matching the catalog, schema, type name and type
criteria are returned. They are ordered by Each type description has the following columns: Note: If the driver does not support UDTs, an empty result set is returned. |
|
|
Each column description has the following columns: The COLUMN_SIZE column represents the specified column size for the given column. For numeric data, this is the maximum precision. For character data, this is the length in characters. For datetime datatypes, this is the length in characters of the String representation (assuming the maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype, this is the length in bytes. Null is returned for data types where the column size is not applicable. |
ResultSet.rowInserted. |
|
|
|
NULL and non-NULL values being
NULL. |
NULL values are sorted at the end regardless of
sort order. |
NULL values are sorted at the start regardless
of sort order. |
NULL values are sorted high.
Sorted high means that NULL values
sort higher than any other value in a domain. In an ascending order,
if this method returns true, NULL values
will appear at the end. By contrast, the method
nullsAreSortedAtEnd indicates whether NULL values
are sorted at the end regardless of sort order. |
NULL values are sorted low.
Sorted low means that NULL values
sort lower than any other value in a domain. In an ascending order,
if this method returns true, NULL values
will appear at the beginning. By contrast, the method
nullsAreSortedAtStart indicates whether NULL values
are sorted at the beginning regardless of sort order. |
|
|
|
|
|
ResultSet object,
the result set's own updates are visible. |
|
|
|
|
|
|