DB2 Connection

Hi, I have a colleague who wishes to post the following question…

"I am trying to install the webMethods DB2 adapter in my Integration
Server 6.1

Step I

The following are the steps I did to make the DB2 Adapter in up and
runnig condition.

a) I unzipped the DB2.zip file in the IntegrationServer\Packages folder
and started the Integration Server.

b) In the “Configure connections screens” under the “Administrator
screen”, I have entered the following properties.

Connection Type – JDBC Adapter Connection,
DataSource Class – COM.ibm.db2.jdbc.app.DB2Driver,
with serverName,UserName,Password,DatabaseName,PortNumber,Network
Protocol properties.

c) Once I saved the changes, the enabled column of the Adapters > JDBC
Adapter > Connections screen, gives me “No”

d) While trying to make the “connection as enable one”, I am getting the
following error.

Error encountered
[ART.118.5042] Adapter Runtime (Connection): Unable to enable connection
resource db2:db2Connection.
[ART.118.5036] Adapter Runtime (Connection): Unable to configure
connection manager.
COM.ibm.db2.jdbc.app.DB2Driver

So any idea how to resolve this issue ?

Step II

Further I tried with writing Java program, in order to connect to the
DB2 database.
I have written 2 programs. They are
a) DB2ApplTest.java
b) DB2Appl.java

I am able to run the “DB2Appl.java” program and it is connect to the DB2
database.

But if I tried to run the “DB2ApplTest.java” program I am getting the
“java.sql.SQLException: No suitable driver” error.

Please find attached the files “DB2ApplTest.java” and “DB2Appl.java”.
Could you please go through both these files and let me know how to
resolve this issue ?

Regards
Sethu "

On behalve of Sethu
Nico

I’ll assume that your connection properties are all accurate as outlied in the JDBC Users Guide…

-After setting the configuration, you need to restart the IS (restarting just the connection will not work).
-Did you download the DB2 zip file and put it in the IntegrationServer/lib/jars directory.
-I believe that the username of the connection must be the same (or at least have the same privleges (i.e. admin)) as the user that created the table initially.

Copy the DB2 driver jar file into IS/lib directory and restart the server. Check the jar file is loaded in Admin console by clicking the About. Try enabling the JDBC connection.

Since you’re using DB2 connect, you have to configure DB2 connect to point to the db. The IS/JDBC Adapter merely connects to DB2 connect, not the db directly. We let our DBA set that up, but you may have to set it up yourself.

In unix, the command to check the DB2 connect configuration is:
$ db2 list db directory

I’ll post some other tips also.

The first time to connect to a new DB2 database, one needs to ask the DBA to sign in the JDBC connection and build a test Adapter service. During this process, the DB2 bound program will invoked for the catalog. Then any other instance connection to the new DB will be fine.

Connecting to a DB2 database with the JDBC adapter requires a few additional tasks. Here is a list of steps to take:

  1. DB2 Connect software must be installed on the physical server housing the IS. Contact a DBA to assist you with the installation.

  2. Ask the DBA to catalog database connections for each server you wish to access.

  3. If you are running webMethods on Unix, you must edit the webMethods user profile to be able to execute DB2 commands. Add the following line to the .profile file located in the user’s home directory:

. /admin/home/instancename/sqllib/db2profile

Where instancename is the name of the DB2 instance created on the server.

  1. Copy the db2java.zip file from /db2_install_directory/java/ to /is_install_directory/IntegrationServer/lib/jars/

  2. Restart the IS.

  3. Create a new JDBC adapter connection to point to a DB2 server. Typically, you only need to supply the following connection properties:

-DataSource Class - COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource

-user

-password

-databaseName - use one of the database alias names set up by the DBA