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.
jdbc:sapdb://<database_computer>[:<port>]/<database_name>[<options>]
Parameter |
Description |
<database_computer> |
Name of database computer |
<port> |
Port of the X server on the database computer. You only have to specify the port if you are not using the default value. See X Server, Ports and Protocols of the X Server |
<database_name> |
Name of database instance |
<options> |
· Parameter url for a connection to database instance DEMODB on the remote computer PARMA:
jdbc:sapdb://PARMA/DEMODB
· Parameter url for a connection to database instance DEMODB on the remote computer PARMA via port 9876. Prerequisite: the X Server uses the same port.
jdbc:sapdb://PARMA:9876/DEMODB
· Parameter url for a connection to database instance DEMODB on a local computer:
jdbc:sapdb:///DEMODB
· Parameter url for a connection to the database instance DEMODB on the local computer; the SQL mode is ORACLE and a command timeout of 120 seconds is defined:
jdbc:sapdb:///DEMODB?sqlmode=ORACLE&timeout=120:
See also:
Examples for Connecting to the Database Instance