View Single Post
  #2 (permalink)  
Old 08-07-2007, 03:31 AM
boy22 boy22 is offline
Member
 
Join Date: Jul 2007
Posts: 36
boy22 is on a distinguished road
java.sql interface DatabaseMetaData

ResultSet getPrimaryKeys (String catalog,String schema,String table)throws SQLException

Retrieves a description of the given table's primary key columns. They are ordered by COLUMN_NAME.

Each primary key column description has the following columns:

TABLE_CAT String => table catalog (may be null)
TABLE_SCHEM String => table schema (may be null)
TABLE_NAME String => table name
COLUMN_NAME String => column name
KEY_SEQ short => sequence number within primary key
PK_NAME String => primary key name (may be null)

Parameters:
catalog - a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means that the catalog name should not be used to narrow the search
schema - a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema; null means that the schema name should not be used to narrow the search
table - a table name; must match the table name as it is stored in the database
Returns:
ResultSet - each row is a primary key column description
Throws:
SQLException - if a database access error occurs
Reply With Quote