Friday, January 28, 2011

Is the IBM DB2 UDB service not running? Can't make JDBC Type 4 connections

IBM DB2 v8 UDB Universal Driver TCP/IP which port windows service JDBC Type 4

Attempting to make a JDBC Type 4 connection (ie pure java talking TCP/IP, no native code) to the DB2 server gives me: IO Exception opening socket to server <myservername> on port 50000.
The DB2 Server may be down.

The DB2 server (running on Windows) is definitely running. In DB2 "Control Center" the "instance" ("DB2" the default name?) is definitely started. Looking at the local TCP ports being listened via netstat -abno there's no 50000 or anything close. So either the service that accepts the Type-4 JDBC connections (UDB) is not running or it's listening on a different port. How do you check?

I couldn't find any mention of this in searching (though I did find "DB2 Version 8 Connectivity Cheat Sheet" which is good reference for DB2 generally), but by accident I stumbled on "Setup communications..." on right clicking the "DB2" instance in DB2 Control Center. From here the rest is straight forward:

  1. so, right click the "DB2" instance and select "Setup communications..."

  2. check TCP/IP

  3. click the Properties button and then just click the Default button to get default values

    • Note the port number: 50000 by default

  4. after clicking OK from the Properties and the communications dialog you'll have to restart the instance

    • right click the "DB2" instance and select Stop and then Start

Now when you check the open ports via netstat -abno you should hopefully see:


To recap the IBM DB2 Universal Driver Type 4 (thin) connection details:
Jar file(s):db2jcc.jar & db2jcc_license_cu.jar