8.6.60 getPrimaryKeys(String catalog, String schema, String table)
- Organization of this subsection
(1) Function
This method acquires information about a specified table's primary key columns.
The information about primary keys that can be acquired depends on the privileges of the HADB user who executes this method. For details about the privileges and the primary key information that can be acquired, see the topic Scope of information in dictionary tables and system tables that can be referenced by HADB users in the HADB Setup and Operation Guide.
(2) Format
public synchronized ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException
(3) Arguments
- String catalog
-
Specifies a catalog name. This argument is ignored, if specified.
- String schema
-
Specifies a schema name pattern#.
- String table
-
Specifies a table name pattern#.
- #
-
For details about the special characters that can be specified in each pattern, see (4) Special characters that can be specified in pattern character strings in 8.6.1 List of the methods in the DatabaseMetaData interface.
(4) Return value
This method returns a ResultSet object. The following table shows the format of the ResultSet object that is returned.
Column No. |
Type |
Column name |
Description |
---|---|---|---|
1 |
String |
TABLE_CAT |
|
2 |
String |
TABLE_SCHEM |
Schema name |
3 |
String |
TABLE_NAME |
Table name |
4 |
String |
COLUMN_NAME |
Column name |
5 |
short |
KEY_SEQ |
Column's order number within the primary key |
6 |
String |
PK_NAME |
Primary key name |
(5) Exceptions
If this Connection object is closed before this method is executed, the JDBC driver throws an SQLException.