|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DatabaseMetaData
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, the ResultSet
getter methods throw an SQLException.
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.
A method that gets information about a feature that the driver does not
support will throw an SQLException.
In the case of methods that return a ResultSet
object, either a ResultSet object (which may be empty) is
returned or an SQLException is thrown.
| Field Summary | |
|---|---|
static short |
attributeNoNulls
Indicates that NULL values might not be allowed. |
static short |
attributeNullable
Indicates that NULL values are definitely allowed. |
static short |
attributeNullableUnknown
Indicates that whether NULL values are allowed is not
known. |
static int |
bestRowNotPseudo
Indicates that the best row identifier is NOT a pseudo column. |
static int |
bestRowPseudo
Indicates that the best row identifier is a pseudo column. |
static int |
bestRowSession
Indicates that the scope of the best row identifier is the remainder of the current session. |
static int |
bestRowTemporary
Indicates that the scope of the best row identifier is very temporary, lasting only while the row is being used. |
static int |
bestRowTransaction
Indicates that the scope of the best row identifier is the remainder of the current transaction. |
static int |
bestRowUnknown
Indicates that the best row identifier may or may not be a pseudo column. |
static int |
columnNoNulls
Indicates that the column might not allow NULL values. |
static int |
columnNullable
Indicates that the column definitely allows NULL values. |
static int |
columnNullableUnknown
Indicates that the nullability of columns is unknown. |
static 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. |
static int |
importedKeyInitiallyDeferred
Indicates deferrability. |
static int |
importedKeyInitiallyImmediate
Indicates deferrability. |
static 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. |
static int |
importedKeyNotDeferrable
Indicates deferrability. |
static 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. |
static 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. |
static 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. |
static int |
procedureColumnIn
Indicates that the column stores IN parameters. |
static int |
procedureColumnInOut
Indicates that the column stores INOUT parameters. |
static int |
procedureColumnOut
Indicates that the column stores OUT parameters. |
static int |
procedureColumnResult
Indicates that the column stores results. |
static int |
procedureColumnReturn
Indicates that the column stores return values. |
static int |
procedureColumnUnknown
Indicates that type of the column is unknown. |
static int |
procedureNoNulls
Indicates that NULL values are not allowed. |
static int |
procedureNoResult
Indicates that the procedure does not return a result. |
static int |
procedureNullable
Indicates that NULL values are allowed. |
static int |
procedureNullableUnknown
Indicates that whether NULL values are allowed
is unknown. |
static int |
procedureResultUnknown
Indicates that it is not known whether the procedure returns a result. |
static int |
procedureReturnsResult
Indicates that the procedure returns a result. |
static int |
sqlStateSQL99
Indicates that the value is an SQL99 SQLSTATE value. |
static int |
sqlStateXOpen
Indicates that the value is an X/Open (now know as Open Group) SQL CLI SQLSTATE value. |
static short |
tableIndexClustered
Indicates that this table index is a clustered index. |
static short |
tableIndexHashed
Indicates that this table index is a hashed index. |
static short |
tableIndexOther
Indicates that this table index is not a clustered index, a hashed index, or table statistics; it is something other than these. |
static short |
tableIndexStatistic
Indicates that this column contains table statistics that are returned in conjunction with a table's index descriptions. |
static int |
typeNoNulls
Indicates that a NULL value is NOT allowed for this
data type. |
static int |
typeNullable
Indicates that a NULL value is allowed for this
data type. |
static int |
typeNullableUnknown
Indicates that it is not known whether a NULL value
is allowed for this data type. |
static int |
typePredBasic
Indicates that one can base all WHERE search clauses
except WHERE . |
static int |
typePredChar
Indicates that the only WHERE search clause that can
be based on this type is WHERE . |
static int |
typePredNone
Indicates that WHERE search clauses are not supported
for this type. |
static int |
typeSearchable
Indicates that all WHERE search clauses can be
based on this type. |
static int |
versionColumnNotPseudo
Indicates that this version column is NOT a pseudo column. |
static int |
versionColumnPseudo
Indicates that this version column is a pseudo column. |
static int |
versionColumnUnknown
Indicates that this version column may or may not be a pseudo column. |
| Method Summary | |
|---|---|
boolean |
allProceduresAreCallable
Retrieves whether the current user can call all the procedures returned by the method getProcedures. |
boolean |
allTablesAreSelectable
Retrieves whether the current user can use all the tables returned by the method getTables in a SELECT
statement. |
boolean |
dataDefinitionCausesTransactionCommit
Retrieves whether a data definition statement within a transaction forces the transaction to commit. |
boolean |
dataDefinitionIgnoredInTransactions
Retrieves whether this database ignores a data definition statement within a transaction. |
boolean |
deletesAreDetected
Retrieves whether or not a visible row delete can be detected by calling the method ResultSet.rowDeleted. |
boolean |
doesMaxRowSizeIncludeBlobs
Retrieves whether the return value for the method getMaxRowSize includes the SQL data types
LONGVARCHAR and LONGVARBINARY. |
ResultSet |
getAttributes
Retrieves a description of the given attribute of the given type for a user-defined type (UDT) that is available in the given schema and catalog. |
ResultSet |
getBestRowIdentifier
Retrieves a description of a table's optimal set of columns that uniquely identifies a row. |
ResultSet |
getCatalogs
Retrieves the catalog names available in this database. |
String |
getCatalogSeparator
Retrieves the String that this database uses as the
separator between a catalog and table name. |
String |
getCatalogTerm
Retrieves the database vendor's preferred term for "catalog". |
ResultSet |
getColumnPrivileges
Retrieves a description of the access rights for a table's columns. |
ResultSet |
getColumns
Retrieves a description of table columns available in the specified catalog. |
Connection |
getConnection
Retrieves the connection that produced this metadata object. |
ResultSet |
getCrossReference
Retrieves a description of the foreign key columns in the given foreign key table that reference the primary key columns of the given primary key table (describe how one table imports another's key). |
int |
getDatabaseMajorVersion
Retrieves the major version number of the underlying database. |
int |
getDatabaseMinorVersion
Retrieves the minor version number of the underlying database. |
String |
getDatabaseProductName
Retrieves the name of this database product. |
String |
getDatabaseProductVersion
Retrieves the version number of this database product. |
int |
getDefaultTransactionIsolation
Retrieves this database's default transaction isolation level. |
int |
getDriverMajorVersion
Retrieves this JDBC driver's major version number. |
int |
getDriverMinorVersion
Retrieves this JDBC driver's minor version number. |
String |
getDriverName
Retrieves the name of this JDBC driver. |
String |
getDriverVersion
Retrieves the version number of this JDBC driver as a String. |
ResultSet |
getExportedKeys
Retrieves a description of the foreign key columns that reference the given table's primary key columns (the foreign keys exported by a table). |
String |
getExtraNameCharacters
Retrieves all the "extra" characters that can be used in unquoted identifier names (those beyond a-z, A-Z, 0-9 and _). |
String |
getIdentifierQuoteString
Retrieves the string used to quote SQL identifiers. |
ResultSet |
getImportedKeys
Retrieves a description of the primary key columns that are referenced by a table's foreign key columns (the primary keys imported by a table). |
ResultSet |
getIndexInfo
Retrieves a description of the given table's indices and statistics. |
int |
getJDBCMajorVersion
Retrieves the major JDBC version number for this driver. |
int |
getJDBCMinorVersion
Retrieves the minor JDBC version number for this driver. |
int |
getMaxBinaryLiteralLength
Retrieves the maximum number of hex characters this database allows in an inline binary literal. |
int |
getMaxCatalogNameLength
Retrieves the maximum number of characters that this database allows in a catalog name. |
int |
getMaxCharLiteralLength
Retrieves the maximum number of characters this database allows for a character literal. |
int |
getMaxColumnNameLength
Retrieves the maximum number of characters this database allows for a column name. |
int |
getMaxColumnsInGroupBy
Retrieves the maximum number of columns this database allows in a GROUP BY clause. |
int |
getMaxColumnsInIndex
Retrieves the maximum number of columns this database allows in an index. |
int |
getMaxColumnsInOrderBy
Retrieves the maximum number of columns this database allows in an ORDER BY clause. |
int |
getMaxColumnsInSelect
Retrieves the maximum number of columns this database allows in a SELECT list. |
int |
getMaxColumnsInTable
Retrieves the maximum number of columns this database allows in a table. |
int |
getMaxConnections
&n |