Format of database URLs

The format of a database URL is determined by whether you are connecting from a client or on the database server.

Note: Starting OneDB JDBC Driver version 8.1.1.3, the use of LDAP to retrieve OneDB server connectivity information from a stored SQLHost files inside of an LDAP server has been removed.
For connections from a client, use the following format:

1 jdbc:onedb://hostname:portnum /database_name;? USER=userid;PASSWORD=password? ONEDB_SERVER=servername;? + ;;name=value

1 ?user=userid;password=password?+ ;;name=value
hostname
This required parameter specifies the host name of the computer that is running the HCL OneDB™ database server.
This parameter is required for client-side JDBC, unless the SQLH_TYPE property is defined or the IFXHOST property is used. This parameter is optional for server-side JDBC.
portnum
This required parameter specifies the port number of the HCL OneDB database server.
This parameter is required for client-side JDBC unless the SQLH_TYPE property is defined.
database_name
This required parameter specifies the name of the HCL OneDB database to connect to. If you do not specify the name of a database, a connection is made to the HCL OneDB database server.
This parameter is not required but highly recommended that the connection is made to the database the application is going to use. Connection pool software presumes you connect to a particular database and may not function correctly if the database name is omitted.
USER=userid
This optional parameter specifies the user ID that is used in connections to the HCL OneDB database server.
This parameter is optional, however, if you specify USER then you must also specify the PASSWORD. If you do not specify the USER and PASSWORD, the driver calls System.getProperty() to obtain the name of the user currently running the application, and the client is assumed to be trusted. Trusted connections without a username/password can only be established when the JDBC client application is running on the same host as the database server.
PASSWORD=password
This optional parameter specifies the password for the specified user ID.
This parameter is optional, however, if you specify password then you must also specify the USER.
name=value
This optional parameter specifies the name-value pair that specifies a value for the HCL OneDB properties that is contained in the name variable, which is recognized by either HCL OneDB JDBC Driver or by HCL OneDB database servers. The name variable is not case-sensitive.
For more information, see Specify Connection Properties and HCL OneDB JDBC Driver properties.

If an LDAP server or sqlhosts file provides the IP address, host name, or port number through the SQLH_TYPE property, you do not have to specify them in the database URL. For more information, see Dynamically reading the HCL OneDB sqlhosts file.

In the following example, the connection syntax for a client-side connection is shown:
jdbc:onedb://123.45.67.89:1533/testDB;
   user=rdtest;password=test