DatabaseMetaData.getExportedKeys
Interface Overview | Interface Members |
This Package |
All Packages
public abstract ResultSet getExportedKeys( String catalog,
String schema,
String table ) throws SQLException
Parameters
- catalog
- a catalog name; "" retrieves those without a
catalog; null means drop catalog name from the selection criteria
- schema
- a schema name pattern; "" retrieves those
without a schema
- table
- a table name
Returns
ResultSet - each row is a foreign key column description
Description
Get a description of the foreign key columns that reference a
table's primary key columns (the foreign keys exported by a
table). They are ordered by FKTABLE_CAT, FKTABLE_SCHEM,
FKTABLE_NAME, and KEY_SEQ.
Each foreign key column description has the following columns:
- PKTABLE_CAT String => primary key table catalog (may be null)
- PKTABLE_SCHEM String => primary key table schema (may be null)
- PKTABLE_NAME String => primary key table name
- PKCOLUMN_NAME String => primary key column name
- FKTABLE_CAT String => foreign key table catalog (may be null)
being exported (may be null)
- FKTABLE_SCHEM String => foreign key table schema (may be null)
being exported (may be null)
- FKTABLE_NAME String => foreign key table name
being exported
- FKCOLUMN_NAME String => foreign key column name
being exported
- KEY_SEQ short => sequence number within foreign key
- UPDATE_RULE short => What happens to
foreign key when primary is updated:
- importedNoAction - do not allow update of primary
key if it has been imported
- importedKeyCascade - change imported key to agree
with primary key update
- importedKeySetNull - change imported key to NULL if
its primary key has been updated
- importedKeySetDefault - change imported key to default values
if its primary key has been updated
- importedKeyRestrict - same as importedKeyNoAction
(for ODBC 2.x compatibility)
- DELETE_RULE short => What happens to
the foreign key when primary is deleted.
- importedKeyNoAction - do not allow delete of primary
key if it has been imported
- importedKeyCascade - delete rows that import a deleted key
- importedKeySetNull - change imported key to NULL if
its primary key has been deleted
- importedKeyRestrict - same as importedKeyNoAction
(for ODBC 2.x compatibility)
- importedKeySetDefault - change imported key to default if
its primary key has been deleted
- FK_NAME String => foreign key name (may be null)
- PK_NAME String => primary key name (may be null)
- DEFERRABILITY short => can the evaluation of foreign key
constraints be deferred until commit
- importedKeyInitiallyDeferred - see SQL92 for definition
- importedKeyInitiallyImmediate - see SQL92 for definition
- importedKeyNotDeferrable - see SQL92 for definition
Exceptions
SQLException
if a database-access error occurs.
See Also
getImportedKeys