10.2.2 getConnection()
- Organization of this subsection
(1) Function
This method connects to the HADB server.
The connection is performed according to the HADB server connection information specified in the DataSource object, and then a Connection object is returned.
Specification priorities apply to the HADB server connection information. For details about the priorities, see 7.3.3 Connection information priorities.
Note that you must have the CONNECT privilege to execute the getConnection method.
(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 in the following cases:
-
A database access error occurs.
-
Specified HADB server connection information is invalid.