Connecting to DB2

From PresenceWiki
Revision as of 08:34, 21 August 2015 by Rob (Talk | contribs)

(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search
Database Connectivity > Connecting to DB2

These instructions are for connecting to IBM DB2 server.


You must have access to the DB2 JDBC driver, which is bundled in a file called db2jcc.jar. You can locate this under your DB2 installation, typically located at:


This file must be imported into the Presence Jar Manager.

Connection Parameters

The Driver class should be as follows:

And the following connection URL should be used:


Typically the port will be 50000 on Windows systems.

Username and Password

DB2 uses system accounts, so the username may need to be fully qualified with the domain, e.g mydomain\user.

Db2 connection.png

Pooling Options

Please note that like SQL Server, when the DB2 instance is stopped and restarted any existing connections to the database remain active, even though they are no longer usable. After restarting the database the following error will be reported by Presence:

Statement failed - [jcc][t4][2030][11211][3.50.152] A communication error occurred during operations on the connection's underlying socket, socket input stream, or socket output stream. Error location: Reply.fill(). Message: Software caused connection abort: recv failed. ERRORCODE=-4499, SQLSTATE=08001

To avoid this error, we recommend using a custom validation query. Select the second tab of the resource editor (see image below) and check "Use custom query to validate connections". Enter a custom query in the field below, for example:

Db2 custom query.png

More information on this can be found under Connection Pooling.

Database Connectivity > Connecting to DB2