java.sql
Interface DatabaseMetaData
-
AllSuperinterfaces:
- Wrapper
-
public interface DatabaseMetaData
extendsWrapper
Comprehensiveinformation about the database as a whole.
Thisinterface is implemented by driver vendors to let users know thecapabilities of a Database Management System (DBMS) in combinationwith the driver based on JDBCTM technology ("JDBC driver")that is used with it. Different relational DBMSs often supportdifferent features, implement features in different ways, and usedifferent data types. In addition, a driver may implement a featureon top of what the DBMS offers. Information returned by methods inthis interface applies to the capabilities of a particular driverand a particular DBMS working together. Note that as used in thisdocumentation, the term "database" is used generically to refer toboth the driver and DBMS.
Auser for this interface is commonly a tool that needs to discoverhow to deal with the underlying DBMS. This is especially true forapplications that are intended to be used with more than one DBMS.For example, a tool might use themethod getTypeInfo
tofind out what data types can be used ina CREATETABLE
statement. Or a user might call themethod supportsCorrelatedSubqueries
tosee if it is possible to use a correlated subqueryor supportsBatchUpdates
tosee if it is possible to use batch updates.
Some DatabaseMetaData
methodsreturn lists of information in the formof ResultSet
objects.Regular ResultSet
methods,suchas getString
and getInt
,can be used to retrieve the data fromthese ResultSet
objects. If a givenform of metadata is not available, anempty ResultSet
willbe returned. Additional columns beyond the columns defined to bereturned bythe ResultSet
objectfor a given method can be defined by the JDBC driver vendor andmust be accessed by their columnlabel.
Some DatabaseMetaData
methodstake arguments that are String patterns. These arguments all havenames such as fooPattern. Within a pattern String, "%" means matchany substring of 0 or more characters, and "_" means match any onecharacter. Only metadata entries matching the search pattern arereturned. If a search pattern argument is setto null
, that argument's criterionwill be dropped from the search.
FieldSummary | |
---|---|
static short | attributeNoNulls Indicatesthat NULL valuesmight not be allowed. |
static short | attributeNullable Indicatesthat NULL values aredefinitely allowed. |
static short | attributeNullableUnknown Indicatesthatwhether NULL valuesare allowed is not known. |
static int | bestRowNotPseudo Indicatesthat the best row identifier is NOT a pseudo column. |
static int | bestRowPseudo Indicatesthat the best row identifier is a pseudo column. |
static int | bestRowSession Indicatesthat the scope of the best row identifier is the remainder of thecurrent session. |
static int | bestRowTemporary Indicatesthat the scope of the best row identifier is very temporary,lasting only while the row is being used. |
static int | bestRowTransaction Indicatesthat the scope of the best row identifier is the remainder of thecurrent transaction. |
static int | bestRowUnknown Indicatesthat the best row identifier may or may not be a pseudocolumn. |
static int | columnNoNulls Indicatesthat the column might notallow NULL values. |
static int | columnNullable Indicatesthat the column definitelyallows NULL values. |
static int | columnNullableUnknown Indicatesthat the nullability of columns is unknown. |
static int | functionColumnIn Indicatesthat the parameter or column is an IN parameter. |
static int | functionColumnInOut Indicatesthat the parameter or column is an INOUT parameter. |
static int | functionColumnOut Indicatesthat the parameter or column is an OUT parameter. |
static int | functionColumnResult Indicatesthat the parameter or column is a column in a result set. |
static int | functionColumnUnknown Indicatesthat type of the parameter or column is unknown. |
static int | functionNoNulls Indicatesthat NULL values arenot allowed. |
static int | functionNoTable Indicatesthat the function does not return a table. |
static int | functionNullable Indicatesthat NULL values areallowed. |
static int | functionNullableUnknown Indicatesthatwhether NULL valuesare allowed is unknown. |
static int | functionResultUnknown Indicatesthat it is not known whether the function returns a result or atable. |
static int | functionReturn Indicatesthat the parameter or column is a return value. |
static int | functionReturnsTable Indicatesthat the function returns a table. |
static int | importedKeyCascade Forthe column UPDATE_RULE , indicatesthat when the primary key is updated, the foreign key (importedkey) is changed to agree with it. |
static int | importedKeyInitiallyDeferred Indicatesdeferrability. |
static int | importedKeyInitiallyImmediate Indicatesdeferrability. |
static int | importedKeyNoAction Forthecolumns UPDATE_RULE and DELETE_RULE ,indicates that if the primary key has been imported, it cannot beupdated or deleted. |
static int | importedKeyNotDeferrable Indicatesdeferrability. |
static int | importedKeyRestrict Forthe column UPDATE_RULE , indicatesthat a primary key may not be updated if it has been imported byanother table as a foreign key. |
static int | importedKeySetDefault Forthecolumns UPDATE_RULE and DELETE_RULE ,indicates that if the primary key is updated or deleted, theforeign key (imported key) is set to the default value. |
static int | importedKeySetNull Forthecolumns UPDATE_RULE and DELETE_RULE ,indicates that when the primary key is updated or deleted, theforeign key (imported key) is changedto NULL . |
static int | procedureColumnIn Indicatesthat the column stores IN parameters. |
static int | procedureColumnInOut Indicatesthat the column stores INOUT parameters. |
static int | procedureColumnOut Indicatesthat the column stores OUT parameters. |
static int | procedureColumnResult Indicatesthat the column stores results. |
static int | procedureColumnReturn Indicatesthat the column stores return values. |
static int | procedureColumnUnknown Indicatesthat type of the column is unknown. |
static int | procedureNoNulls Indicatesthat NULL values arenot allowed. |
static int | procedureNoResult Indicatesthat the procedure does not return a result. |
static int | procedureNullable Indicatesthat NULL values areallowed. |
static int | procedureNullableUnknown Indicatesthatwhether NULL valuesare allowed is unknown. |
static int | procedureResultUnknown Indicatesthat it is not known whether the procedure returns a result. |
static int | procedureReturnsResult Indicatesthat the procedure returns a result. |
static int | sqlStateSQL Apossible return value for themethod DatabaseMetaData.getSQLStateType whichis used to indicate whether the value returned by themethod SQLException.getSQLState isan SQLSTATE value. |
static int | sqlStateSQL99 Apossible return value for themethod DatabaseMetaData.getSQLStateType whichis used to indicate whether the value returned by themethod SQLException.getSQLState isan SQL99 SQLSTATE value. |
static int | sqlStateXOpen Apossible return value for themethod DatabaseMetaData.getSQLStateType whichis used to indicate whether the value returned by themethod SQLException.getSQLState isan X/Open (now know as Open Group) SQL CLI SQLSTATE value. |
static short | tableIndexClustered Indicatesthat this table index is a clustered index. |
static short | tableIndexHashed Indicatesthat this table index is a hashed index. |
static short | tableIndexOther Indicatesthat this table index is not a clustered index, a hashed index, ortable statistics; it is something other than these. |
static short | tableIndexStatistic Indicatesthat this column contains table statistics that are returned inconjunction with a table's index descriptions. |