Entering content frame

 Defining the Connection URL 

Use

You use the method java.sql.DriverManager.getConnection to connect to the database instance. You use the url parameter in this method to specify the name of the database computer and the database instance.

Procedure

Define the connection URL. Use the following format:

jdbc:sapdb://<database_server>[:<port>]/<database_name>[<options>]

 

Parameter

Description

database_server

Name of the database computer

port

Socket port to which you want to connect
Specify this port only if the X Server has been configured with a port that is not the system default port.

database_name

Name of the database instance

options

Connection options

 

Definition of the parameter url for a connection to the database TST on the computer REMOTESERVER

jdbc:sapdb:// REMOTESERVER/TST

 

Definition of the parameter url for a connection to the database TST on the remote computer REMOTESERVER using the port 9876. (This definition requires the X Server to be configured with the same port.)

jdbc:sapdb://servermachine:9876/TST

 

Definition of the parameter url for a connection to the database TST on the local computer

jdbc:sapdb:///TST

 

Definition of the parameter url for a connection to the database TST on the local computer; the SQL mode is ORACLE and a command timeout of 120 seconds is defined:

jdbc:sapdb:///TST?sqlmode=ORACLE&timeout=120:

 

See also:

Examples for Connecting to the Database

 

Leaving content frame