This topic describes configuring WebSphere Application Server on a Linux or UNIX-based platform to use multiple DB2 clients, including a V7 client and a V8.1 client.
Before you begin
In WebSphere Application Server Version 4, environment variables required for accessing a DB2 database, such as CLASSPATH, native library path, db2instance name and so on, are included or initialized in the WebSphere Application Server admin.config file or in the setupCmdLine.sh and the startServer.sh command scripts. Because WebSphere Application Server V5.x does not store administration repository information in a relational database management system (RDBMS), a database is not a prerequisite. Therefore, the installation and configuration of V5.x do not involve database configuration.With the introduction of DB2 UDB Version 8.1, you can install both DB2 Version 7 and Version 8.1, or multiple DB2 Version 8.1 instances on the same Linux or UNIX machine. This topic describes configuring V5.x on a Linux or UNIX-based platform to use multiple DB2 clients, including a V7 client and a V8.1 client.
For more information about migrating to DB2 V8.1.3, see Migration to Version 8 at http://www-3.ibm.com/ cgi-bin/ db2www/ data/ db2/ udb/ winos2unix/ support/ v8infocenter.d2w/ report?target=mainFrame&fn=c0009326.htm . (This Web address has spaces for formatting. Remove all spaces when pasting the address into a browser.)
Why and when to perform this task
If your WebSphere Application Server V5.x machine has only a Version 7 client or a Version 8.1 client installed, and all DB2 data sources defined in WebSphere Application Server access DB2 databases through this client, source the db2profile file in the login profile of your V5.x instance owner, invoke the script db2_home/java12/usejdbc2 to use the JDBC2 drivers instead of the default JDBC1 drivers, and put the DB2 lib directory in the java.library.path variable.
For example, assume that the following values are true:
WebSphere Application Server instance owner, that is the administrative user who starts WebSphere Application Server | adm00001 |
DB2 client instance owner | db2inst1 |
DB2 client instance home | /export/home/db2inst1 |
Steps for this task
Add the following line:
. /export/home/db2inst1/sqllib/db2profile
You can also add the line to the setupCmdLine.sh script of WebSphere Application Server.
You have two ways to specify the JDBC provider class path on the DB2 JDBC Provider definition panel of the WebSphere Application Server administration console:
Windows platforms support only one DB2 installation. The DB2 environment variables are populated in the system environment automatically. WebSphere Application Server does not need to set these environment variables.
Use the value of the DB2 native library path, such as /export/home/db2v7/sqllib/java12:/export/home/db2v7/sqllib/lib for a V7 client, or /export/home/db2v8/sqllib/lib for a V8.1 client.
The DB2 lib directory must be on the java.library.path path. Otherwise the Application Server cannot load the db2jdbc.so library and cannot work with DB2. Even with the DB2 lib directory on the java.library.path path, you must invoke the /home/db2inst1/db2profile environment into the root shell before you start the Application Server.
In cases where both a DB2 V7 client and a V8.1 client are installed on a WebSphere Application Server V5.0.x machine, or multiple V8.1 clients are installed on a WebSphere Application Server V5.0.x or V5.1.x machine, and you intend to use two or more clients in your V5.x Application Servers, you can set DB2 environment variables based on each Application Server, instead of setting them globally as shown previously.
DB2 UDB V8 uses a new client and server communications mechanism that is based on distributed relational database architecture. While the new communications mechanism provides a number of advantages, it also introduces restrictions on the communications capability between DB2 V7 and V8 products.
Because a number of restrictions exist when using a V8 client to communicate with a V7 server, this configuration is not recommended. However, a V7 client can access a V8 server without difficulty.
If you have a WebSphere Application Server application that accesses both a V7 server and a V8 server, only one V7 client is required on the Application Server instance. Use this client to access both the V7 server and the V8 server.
You can choose to use a V7 client to access a V7 server, and use a V8 client to access a V8 server. This choice results in two versions of DB2 clients on the same WebSphere Application Server machine.
When you use a V7 client to access a V8 server, you must explicitly bind V7 packages to the V8 server. To bind packages in the V7 client environment, make a connection to the V8 server and bind both the db2cli.lst and the db2ubind.lst files. For example:
cd /home/db2inst1/sqllib/bnd db2 connect to v8server db2 bind @db2cli.lst db2 bind @db2ubind.lst db2 terminate
One WebSphere Application Server node can support multiple Application Server instances. Each Application Server is essentially a single Java run-time environment, which is one Java virtual machine (JVM). Each JVM can have its own set of environment variables that differ from other Application Server instances.
You can set DB2 environment variables per Application Server instance to let each Application Server instance communicate with a single DB2 client instance. The client instance can have multiple databases cataloged.
Such a configuration means that you cannot have one Application Server instance communicating with both a V7 client and a V8.1 client. However, you can create another Application Server instance to communicate with a different DB2 client.
When mapping a data source to an application component, do not mismatch data sources from different DB2 client instances.
For example, if you set the server1 Application Server instance to run in the DB2 V7 client instance, server1 application components can use only data sources defined under the same V7 client JDBC driver.
WebSphere Application Server V5.x supports defining a JDBC provider on different scopes: cell, node (the default) and server. If you have different DB2 client instances, consider defining them on the server level instead of on the node level. Server level definitions avoid possible mismatches between the data sources and different DB2 JDBC providers.
Results
You can configure DB2 for use on WebSphere Application Server. Tune your WebSphere Application Server environment as you test it. Test all redeployed applications before moving them into production.What to do next
Return to Installing WebSphere Application Server products to continue.