URL database parameter
Description
The location of the database to which you want to connect
using the JDBC interface.
You must specify the URL parameter before connecting
to the database.
Controls
-
JDB JDBC
Syntax
1 |
URL='<span>URL_address</span>' |
Default
None
Usage
The database URL is obtained from the database JDBC driver
documentation. A list of registered Driver classes, with their URLs,
is maintained by the driver’s JDBC DriverManager class.
When a connection request is made, the DriverManager attempts to
locate a suitable driver from those listed.
The URL uses this general format:
1 |
<span>jdbc</span>:<span>vendor</span>:<span>driverprotocol</span>:<span>servername</span>:<span>port/</span><span>database</span> |
Argument |
Description |
---|---|
jdbc |
Driver |
vendor |
Database vendor (such as SAP or Oracle) |
driverprotocol |
Database communications protocol |
servername |
DNS machine name or database host name |
port |
TCP/IP port number configured |
database |
(optional) Name of a specific database |
The database URL can also include the user ID and password
as follows:
1 |
<span>jdbc:</span><span>vendor</span>:<span>driverprotocol</span>:<span>userid</span>/<span>password</span>@<span>servername</span>:<span>port</span>:<span>database</span> |
Examples
Example 1
To set the URL to a database accessed through jConnect:
-
Database profile
Type the following in the URL box on the Connection page in
the Database Profile Setup dialog box:1jdbc:sybase:Tds:199.93.178.151:5007/tsdata -
Application
Type the following in code:
1SQLCA.DbParameter="URL='jdbc:sybase:Tds:199.93.178.151:5007/tsdata'"
Example 2
To set the URL to a database accessed through the Oracle JDBC driver:
-
Database profile
Type the following in the URL box on the Connection page in
the Database Profile Setup dialog box:1jdbc:oracle:thin:@ora80nt:1521:orcl -
Application
Type the following in code:
1SQLCA.DbParameter="URL='jdbc:oracle:thin:@ora80nt:1521:orcl'"
Example 3
To set the URL, which includes the user ID and password, to
a database accessed through the Oracle JDBC driver:
-
Database profile
Type the following in the URL box on the Connection page in
the Database Profile Setup dialog box:1jdbc:oracle:thin:system/manager@ora80nt:1521:orcl -
Application
Type the following in code:
1SQLCA.DbParameter="URL='jdbc:oracle:thin:system/manager@ora80nt:1521:orcl'"