Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

11.1.3 Generating and terminating an SQL connection

Organization of this subsection
(1) Generating an SQL connection
(2) Terminating an SQL connection

(1) Generating an SQL connection

Table 11-1 shows the times at which an SQL connection is generated, the connection-destination RD-node for the generated SQL connection, and the authorization identifier contained in the generated SQL connection.

Table 11-1 Generating an SQL connection

Generation time Connection-destination RD-node Authorization identifier
Execution of CONNECT statement without RD-node specification Default RD-node Authorization identifier specified in the CONNECT statement; if omitted, the authorization identifier specified in the PDUSER client environment variable.
Execution of CONNECT statement with RD-node specification after the default SQL connection has been generated Specified distributed RDnode Authorization identifier specified in the CONNECT statement with RD-node specification; if omitted, the authorization identifier contained in the default SQL connection.
Execution of CONNECT statement with RD-node specification before the default SQL connection has been generated* Default RD-node Authorization identifier specified in the PDUSER client environment variable.
Specified distributed RDnode Authorization identifier specified in the CONNECT statement with RD-node specification; if omitted, the authorization identifier specified in the PDUSER client environment variable.
Default SQL connection is used to execute SQL statements for accessing the database of a distributed RD-node before an SQL connection to the distributed RD-node has been generated* Distributed RD-node where the database to be accessed is located Authorization identifier contained in the default SQL connection.

* To access the database of a distributed RD-node, both an SQL connection to that distributed RD-node and the default SQL connection are required. Therefore, if a UAP issues a CONNECT statement with RD-node specification before the default SQL connection is generated, the HiRDB client generates the default SQL connection automatically. Also, if the UAP issues an SQL statement that uses the default SQL connection for accessing the database of a distributed RD-node before an SQL connection to the distributed RD-node is generated, the HiRDB of the default RD-node generates automatically an SQL connection to that distributed RD-node. For details about how to use the default SQL connection for accessing the database of a distributed RD-node, see 11.2.2 Using the default SQL connection.

(2) Terminating an SQL connection

An SQL connection is terminated in the following cases:

There can be only one SQL connection to a distributed RD-node at a time. After a DISCONNECT statement with RD-node specification is used to delete the existing SQL connection to a distributed RD-node, an SQL connection to another distributed RDnode can be created.