Hitachi

Hitachi Advanced Database Application Development Guide


8.6.19 getCrossReference(String parentCatalog, String parentSchema, String parentTable, String foreignCatalog, String foreignSchema, String foreignTable)

Organization of this subsection

(1) Function

This method acquires cross-reference information between a specified referencing table and a specified referenced table.

The cross-reference information that can be acquired depends on the privileges of the HADB user who executes this method. For details about the relationship between privileges and the 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 getCrossReference
       (String parentCatalog,String parentSchema, String parentTable,
        String foreignCatalog, String foreignSchema, String foreignTable)
       throws SQLException

(3) Arguments

String parentCatalog

Specifies the catalog name of the referenced table. This argument is ignored, if specified.

String parentSchema

Specifies the schema name pattern# of the referenced table.

String parentTable

Specifies the table name pattern# of the referenced table.

String foreignCatalog

Specifies the catalog name of the referencing table. This argument is ignored, if specified.

String foreignSchema

Specifies the schema name pattern# of the referencing table.

String foreignTable

Specifies the table name pattern# of the referencing table.

#

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 following table shows the format of the ResultSet object that is returned.

Table 8‒49: Format of the ResultSet object that is returned (getCrossReference method)

Column No.

Type

Column name

Description

1

String

PKTABLE_CAT

Catalog name of the referenced table

The method always returns a null character string.

2

String

PKTABLE_SCHEM

Schema name of the referenced table

3

String

PKTABLE_NAME

Table name of the referenced table

4

String

PKCOLUMN_NAME

Column name of primary key

5

String

FKTABLE_CAT

Catalog name of the referencing table

The method always returns a null character string.

6

String

FKTABLE_SCHEM

Schema name of the referencing table

7

String

FKTABLE_NAME

Table name of the referencing table

8

String

FKCOLUMN_NAME

Column name of foreign key

9

short

KEY_SEQ

Sequence number of foreign key

10

short

UPDATE_RULE

Operation that is applied to foreign keys when the primary key is updated

  • importedKeyNoAction: The primary key cannot be updated. However, if referential constraint check suppression (DISABLE) is specified in the referential constraint definition in the CREATE TABLE statement, the primary key can be updated.

11

short

DELETE_RULE

Operation that is applied to foreign keys when the primary key is deleted

  • importedKeyNoAction: The primary key cannot be deleted. However, if referential constraint check suppression (DISABLE) is specified in the referential constraint definition in the CREATE TABLE statement, the primary key can be deleted.

12

String

FK_NAME

Constraint name of referential constraints

13

String

PK_NAME

Index name of the primary key

14

short

DEFERRABILITY

Whether evaluation of constraints on the foreign key can be postponed until the transaction is committed

  • importedKeyNotDeferrable: Cannot be postponed.

(5) Exceptions

If this Connection object is closed before this method is executed, the JDBC driver throws an SQLException.