Specifying a database URL
To connect to a database server running on a remote host, you need a Java Database Connectivity (JDBC) driver installed on the client.
The Z and I Emulator for Web client and the Database On-Demand client already include a JDBC driver from the AS/400 Toolbox for Java. This driver allows a client to access DB2/400 data on a properly configured iSeries or AS/400.
If you need a different JDBC driver, contact your administrator to obtain the driver.
A database URL is a Universal Resource Locator (URL) that specifies a particular type of database server (compatible with the local JDBC driver) and a particular host. The following table shows the correct format for a database URL when you are using the JDBC driver that is included with the Z and I Emulator for Web client and the Database On-Demand client.
JDBC driver description: | Format of database URL: | Examples: |
---|---|---|
AS/400 Toolbox for Java | jdbc:as400:// [host] |
|
If you are using another type of JDBC driver, contact your administrator for the correct format for the database URL.
If you are connecting to a database server running on an iSeries host, and you want to use the i5/OS or OS/400 proxy server on the Z and I Emulator for Web server (or the Database On-Demand server), then append the server name and the proxy server port number to the database URL.
Here is the full format:
jdbc:as400://
[host];proxy server=
ZIEWebServerName:proxyServerPort
For example,
jdbc:as400://myiSeries;proxy server=myZIEWebServer:3470
In addition, if you are using a Java 2-enabled browser connecting to a database server running OS/400 V5R2 or later on an iSeries host, you can specify a database to use for the connection, including one stored in an independent auxiliary storage pool, by using the "database name" property.
Here is the full format:
jdbc:as400://[host];database name=name
For example,
jdbc:as400://myiSeries;database name=IASP1
The following table provides detailed information about the "proxy server", "server", and "database name" connection properties.
Property | Description | Required | Choices | Default |
---|---|---|---|---|
"proxy server" | Specifies the host name and port of the middle-tier machine where the proxy server is running. The format
for this is
hostname[:
port], where the port is optional. If this is not set, then the hostname and port are retrieved from the
com.ibm.as400.access.AS400.proxyServer property. The default port is
3470 (if the connection uses SSL, the default port is
3471). The ProxyServer must be running on the middle-tier machine.
The name of the middle-tier machine is ignored in a two-tier environment. |
no | Proxy server host name and port | (value of the proxyServer property, or none if not set) |
"secure" | Specifies whether a Secure Sockets Layer (SSL) connection is used to communicate with the server. SSL connections are only available when connecting to servers at V4R4 or later. | no | "true" (encrypt all client/server communication) "false" (encrypt only the password) | "false" |
"database name" | Specifies the database to use for the connection, including one stored in an independent auxiliary storage
pool. This property applies only when connecting to a V5R2 or later version of the i5/OS or OS/400. When you specify a
database name, the name must exist in the relational database directory on the server. The following criteria determine which
database is accessed:
|
no | Database name |