After setting the CLASSPATH, the required connection information needs to be passed in the form of a connection URL. The following example includes the properties required for connecting with user ID and password authentication.

Connection URL Syntax

The connection URL takes the following form:

jdbc:datadirect:saphana://server_name:port_number;User=user_name;
Password=password;[property=value[;...]];

where:

server_name
specifies either the IP address or the server name of the primary database server.
port_number
specifies the TCP port of the primary database server that is listening for connections to the database.
user_name
Specifies the user ID used to authenticate to SAP HANA with user ID and password authentication method.
password
Specifies the password used to authenticate to SAP HANA with user ID and password authentication method.

Important: The password is a confidential value used to authenticate to the server. To prevent unauthorized access, this value must be securely maintained.

property=value
specifies connection property settings. Multiple properties are separated by a semi-colon.

The following example connection string includes the properties required for connecting with the user ID and password authentication.

Connection conn = DriverManager.getConnection
("jdbc:datadirect:saphana://MyServer:30015;User=JSmith;Password=secret");