DatabaseMetaData.getPrimaryKeys

DatabaseMetaData.getPrimaryKeys

Interface Overview | Interface Members | This Package | All Packages

Syntax
public abstract ResultSet getPrimaryKeys( 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 primary key column description
Description
Get a description of a table's primary key columns. They are ordered by COLUMN_NAME.

Each primary key column description has the following columns:

  1. TABLE_CAT String => table catalog (may be null)
  2. TABLE_SCHEM String => table schema (may be null)
  3. TABLE_NAME String => table name
  4. COLUMN_NAME String => column name
  5. KEY_SEQ short => sequence number within primary key
  6. PK_NAME String => primary key name (may be null)

Exceptions
SQLException if a database-access error occurs.