8.1.3 connect(String url, Properties info)
- Organization of this subsection
(1) Function
This method connects to an HADB server according to the connection information.
Note that you must have the CONNECT privilege to execute the connect method.
(2) Format
public Connection connect(String url, Properties info) throws SQLException
(3) Arguments
- String url
-
Specifies the URL to be used for connection.
For details about the specification format of the URL to be used for connection, see (a) Values to be specified in the url argument (specifying the URL for the connection) in (2) Connecting to the HADB server with the getConnection method in 7.3.1 Using the getConnection method of the DriverManager class to connect to the HADB server.
- Properties info
-
Specifies a list of property names and their values as the connection arguments. For details about the specification format, see (d) Values to be specified in the info argument (specifying the user properties) in (2) Connecting to the HADB server with the getConnection method in 7.3.1 Using the getConnection method of the DriverManager class to connect to the HADB server.
(4) Return value
The method returns a Connection object.
If the specified URL is not valid (the JDBC driver cannot connect to the database specified by the URL), the method returns null.
(5) Exceptions
The JDBC driver throws an SQLException in the following cases:
-
A database access error occurs.
-
The specified connection information is not valid.
(6) Notes
You can set connection information in a number of locations, such as in various properties and methods. For details about the priority of connection information to be applied, see (1) Connection information needed when a connection to the HADB server is established in 7.3.3 Connection information priorities.