8.6.35 getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate)
- Organization of this subsection
(1) Function
This method acquires information about indexes.
The information about indexes that can be acquired depends on the privileges of the HADB user who executes this method. For details about the privileges and the index 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 getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) throws SQLException
(3) Arguments
- String catalog
-
Specifies a catalog name. This argument is ignored, if specified.
- String schema
-
Specifies a schema name pattern#. This value is case sensitive.
- String table
-
Specifies a table name pattern#. This value is case sensitive.
- boolean unique
-
Specifies the unique attribute. Specify one of the following values:
true: Acquires information for unique indexes only.
false: Acquires all index information.
- boolean approximate
-
You do not need to specify this value. If specified, the specification is ignored.
- #
-
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
The 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 |
Catalog name. The method always returns a null character string. |
2 |
String |
TABLE_SCHEM |
Schema name |
3 |
String |
TABLE_NAME |
Table name |
4 |
boolean |
NON_UNIQUE |
If the key values for which the index is defined (total value of one or multiple columns defined as the index) are different in every row, the method returns false; otherwise, the method returns true. |
5 |
String |
INDEX_QUALIFIER |
Index's catalog name. The method always returns a null character string. |
6 |
String |
INDEX_NAME |
Index identifier |
7 |
short |
TYPE |
Index type. The method always returns DatabaseMetaData.tableIndexOther. |
8 |
short |
ORDINAL_POSITION |
The null value is always returned. |
9 |
String |
COLUMN_NAME |
The method always returns a null character string. |
10 |
String |
ASC_OR_DESC |
The method always returns a null character string. |
11 |
int |
CARDINALITY |
Number of unique values in the index. The null value is always returned. |
12 |
int |
PAGES |
Number of pages used for the index. The null value is always returned. |
13 |
String |
FILTER_CONDITION |
Filter condition. The method always returns a null character string. |
(5) Exceptions
If this Connection object is closed before this method is executed, the JDBC driver throws an SQLException.