10.3.5 getPooledConnection(String user, String password)
- Organization of this subsection
(1) Function
This method creates a PooledConnection object from the connection information specified in the arguments and the connection information contained in the DataSource object.
Specification priorities apply to the authorization identifier and password. For details about the priorities, see 7.3.3 Connection information priorities.
Note that you must have the CONNECT privilege to execute the getPooledConnection method.
(2) Format
public synchronized PooledConnection getPooledConnection(String user, String password) throws SQLException
(3) Arguments
- String user
-
Specifies the authorization identifier that is to be used to connect to the HADB server.
- String password
-
Specifies a password for the authorization identifier that is to be used to connect to the HADB server.
If null is specified for user or password, the JDBC driver assumes that no authorization identifier or password, respectively, is specified. If a character string with a length of zero is specified for password, the JDBC driver also assumes that no password is specified.
The authorization identifier specified for user takes precedence over the authorization identifier specified by the setUser method. Similarly, the password specified for password takes precedence over the password specified by the setPassword method.
(4) Return value
This method returns a PooledConnection object.
(5) Exceptions
The JDBC driver throws an SQLException in the following case:
-
The authorization identifier specified for user is a character string with a length of zero.