The easiest way to resolve the problem is to copy the JDBC
driver files to the Deployment Manager machine. In some cases, it is not
desirable to do this. The WebSphere Application Server Information Center
includes the following recommendation on how to set up data sources in an
Network Deployment environment:
http://publib.boulder.ibm.com/infocenter/ws51help/index.jsp?
topic=/com.ibm.websphere.nd.doc/info/ae/ae/tdat_mcrtpds.html
Creating a JDBC provider on multiple nodes
Why and when to perform this task
These are the instructions to create a JDBC provider in a Network
Development (ND) environment. This sample configuration involves two Base
nodes: node A and node B federated with Deployment Manager node C.
Steps for this task
- Open the administrative console.
- Click Resources > JDBC Providers.
The default listing is at the node level.
- Leave the node text field blank and click Apply to change the
scope to the cell level.
- Click New to create a new JDBC provider at the cell level.
The classpath for your new JDBC provider will already be filled in, and
part of that classpath will be specified using a symbolic variable, for
example ${DB2390_JDBC_DRIVER_PATH}/classes/db2j2classes.zip . Leave
it at the default.
- Finish creating the JDBC provider.
- Click Environment.
- Click Manage WebSphere Application Server Variables.
- For each node, select the symbolic variable used in the classpath of
your JDBC provider, and provide a value that is appropriate for the
selected node.
For example, if the classpath of your JDBC provider uses the symbolic
variable ${DB2390_JDBC_DRIVER_PATH}, you might supply the value
/usr/lpp/db2 on one node and /usr/lpp/db2710 on another node, depending on
where your DB2 390 installation is located.
- Click DB2_JDBC_DRIVER_PATH (this already exists by default).
Here provide the path (in the value field) where db2java.zip
exists on the selected node.
- Click Apply and save the changes.
This variable must be defined on each node under the cell.
The above configuration, however, does not always produce a positive
result for the Test Connection Button, although it will work for your
actual application. The reason it may not work is WebSphere Application
Server could still look for the JDBC driver files on the dmgr machine as
described in this portion of the Information Center:
http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1/index.jsp?
topic=/com.ibm.websphere.nd.doc/info/ae/ae/tdat_verifycon.html
You can test your connection from the data source collection view or
the data source details view. Access either view in the administrative
console, and then select a connection from the list. Click the test
connection button on the connection.
You must complete all the steps and restart the server before you test
the connection. Neither the authentication data alias nor the WebSphere
Application Server environment variables (in Version 5.0.1) are available
before a server restart.
In the Network Deployment environment, your test connection results
depend on the Java™ Virtual Machine (JVM) that was running when you
created the data source. If you defined the data source at the cell level,
the test connection occurs on the deployment manager (dmgr). If you
defined the data source at the node or server level, the test connection
occurs on the node agent. You must restart the dmgr or the node agent on
which the data source was defined, to acquire new or updated JAAS
authentication alias entries and environment variables.
In a default WebSphere Application Server installation, the database
driver path environment variables as, for example,
DB2_JDBC_DRIVER_PATH, are defined and initialized to NULL at the
node level. If you create a cell level data source and add the environment
variable note indicating the node level environment variable will override
the cell level value, your test connection will validate the datasource;
however, your application programs will not work because the path to the
database driver files is NULL. Ensure your default WebSphere Application
Server database driver path environment variables are deleted or set to
suitable values.
The following table illustrates the combinations of data sources and
related environment variables that can be tested:
Testing connections on different data source and environment
variable combinations
Data sources |
Cell level variables |
Node level variables |
Server level variables |
Cell level |
Ok |
Fail |
Fail |
Node level |
Ok |
Ok |
Fail |
Server level |
Ok |
Ok |
Ok |
|