Hitachi

Hitachi Advanced Database Application Development Guide


10.4.4 getConnection()

Organization of this subsection

(1) Function

This method connects to the HADB server by using a connection pooled in the connection pool. If all connections pooled in the connection pool are in use, this method establishes a new physical connection with the HADB server to connect to the HADB server.

Note that you must have the CONNECT privilege to execute the getConnection method.

Note
  • A physical connection with the HADB server is not closed until this class object is closed. The physical connection with the HADB server is maintained even if the close method is executed on the Connection object (this class object maintains the physical connection). This connection is used again the next time the getConnection method is executed.

  • When a connection pooled in the connection pool is used to connect to the HADB server, the timeout value for HADB server connection processing that was specified by the setLoginTimeout method is not applied. Normally, the timeout value specified by the setLoginTimeout method is used to monitor the time required for communication processing when a physical connection is established with the HADB server. This timeout value is not applied when a connection pooled in the connection pool is used to connect to the HADB server because no physical connection occurs (no time is required for communication processing).

(2) Format

public synchronized Connection getConnection() throws SQLException

(3) Arguments

None.

(4) Return value

This method returns a Connection object.

(5) Exceptions

The JDBC driver throws an SQLException if a database access error occurs.