Scalable Database Server, HiRDB Version 8 UAP Development Guide

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

17.6.2 Connection pool

Organization of this subsection
(1) ConnectionPoolDataSource interface
(2) PooledConnection interface

(1) ConnectionPoolDataSource interface

For details and usage information about the methods provided by the ConnectionPoolDataSource interface, see the JDBC documentation. This section shows the ConnectionPoolDataSource interface methods that are supported by the JDBC driver.

(a) Methods

Table 17-24 lists the methods of the ConnectionPoolDataSource interface.

Table 17-24 ConnectionPoolDataSource interface methods

Method Remarks
getLoginTimeout() This method returns the value specified by the setLoginTimeout method. If no value was specified by the setLoginTimeout method, this method returns 0.
getLogWriter() --
getPooledConnection() For details about the priorities among the setting methods for authorization identifiers and passwords, see 17.11 Connection information priorities.
getPooledConnection(String user,String password) If the user or password argument is the null value, this method indicates that no authorization identifier or password was specified by this argument.
If the password argument is a character string whose length is 0, this method indicates that no password was specified.
For details about the setting value used when a password is not specified, see 17.11 Connection information priorities.
If the user argument is a character string whose length is 0, this method throws an SQLException.
setLoginTimeout(int seconds) This specification is used only for the physical connection time with the HiRDB server. When 0 is specified or when the setLoginTimeout method is not executed, the time that was specified in PDCONNECTWAITTIME in the client environment definition becomes the maximum wait time for the HiRDB server.
If a value outside the range 0-300 is specified, this method throws an SQLException exception.
setLogWriter(PrintWriter out) --

Legend:
--: None.
(b) Package and class names

The names of the package and class for using this interface directly are as follows:

Package name: JP.co.Hitachi.soft.HiRDB.JDBC

Class name: PrdbConnectionPoolDataSource

(2) PooledConnection interface

For details and usage information about the methods provided by the PooledConnection interface, see the JDBC documentation. This section shows the PooledConnection interface methods that are supported by the JDBC driver.

(a) Methods

Table 17-25 lists the methods of the PooledConnection interface.

Table 17-25 PooledConnection interface methods

Method Remarks
getConnection() The returned Connection object has a 1-to-1 relationship with the physical connection with the HiRDB server, and a physical connection is established as necessary. Once a physical connection is established, it is not disconnected until this class object is closed. Even if the close method is executed for the Connection object, the class object retains the physical connection without closing it. The retained physical connection is reused the next time the application calls this method to request a connection. (The wait time that was specified with the setLoginTimeout method or in PDCONNECTWAITTIME in the client environment definition does not occur.)
addConnectionEventListener(ConnectionEventListener listener) Methods of the JDBC driver are not called from the event listener registered with this method. If the event listener tries to call a method, the JDBC driver may not respond.
close() This method closes a physical connection. Even if a Connection object is obtained and the database is being accessed, this method tries to physically close the connection when it is executed.
removeConnectionEventListener(ConnectionEventListener listener) --

Legend:
--: None
(b) Package and class names

The names of the package and class for using this interface directly are as follows:

Package name: JP.co.Hitachi.soft.HiRDB.JDBC

Class name: PrdbPooledConnection