8

I have now tried 2 days to connect to external DB2 database with SQuirreL. I always get error:

[jcc][t4][2030][11211][3.58.82] A communication error occurred during operations
on the connection's underlying socket, socket input stream, or socket output
stream. Error location: Reply.fill().  Message: Insufficient data.
ERRORCODE=-4499, SQLSTATE=08001

I am using IBM DB2 Universal JDBC driver v9.7 FP5. I have as well tried v9.5.

One thing is that the DB2 is tunneled with Putty. Server runs linux with IBM DB2 v7.1. I am using Win7x64.

I have ran over many forum topics on the web which cover this error, but none of them has actually worked for me. (ie. iReport to DB2 connection ERRORCODE=-4499, SQLSTATE=08001)

First I thought that maybe this related to port that isn't corretcly tunneled. But I removed the port from Putty session conf and different error occured.

Stack trace as well for the problem:

com.ibm.db2.jcc.am.io: [jcc][t4][2030][11211][3.58.82] A communication error
occurred during operations on the connection's underlying socket, socket input
stream, or socket output stream.  Error location: Reply.fill().  Message:
Insufficient data. ERRORCODE=-4499, SQLSTATE=08001
    at com.ibm.db2.jcc.am.ed.a(ed.java:319)
    at com.ibm.db2.jcc.t4.a.a(a.java:416)
    at com.ibm.db2.jcc.t4.a.a(a.java:411)
    at com.ibm.db2.jcc.t4.cb.b(cb.java:227)
    at com.ibm.db2.jcc.t4.cb.c(cb.java:249)
    at com.ibm.db2.jcc.t4.cb.c(cb.java:360)
    at com.ibm.db2.jcc.t4.cb.v(cb.java:1145)
    at com.ibm.db2.jcc.t4.db.a(db.java:42)
    at com.ibm.db2.jcc.t4.b.m(b.java:1238)
    at com.ibm.db2.jcc.t4.b.b(b.java:1112)
    at com.ibm.db2.jcc.t4.b.c(b.java:700)
    at com.ibm.db2.jcc.t4.b.b(b.java:686)
    at com.ibm.db2.jcc.t4.b.a(b.java:367)
    at com.ibm.db2.jcc.t4.b.<init>(b.java:307)
    at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(DB2SimpleDataSource.java:214)
    at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:456)

My best guess was and is still that JDBC universal driver is not backward compatible with DB2 v7.1.

It works on an other development machine (coworker) with 32bit XP on it. I have tried to put it working on different 32bit XP but the same result occurs.

Can anyone at least describe the root of this anomaly?

Edit

http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14779629 This cannot be a firewall or tunneling error. Successfully opened a tunnel to correct port with telnet.

Community
  • 1
  • 1
vellotis
  • 829
  • 1
  • 12
  • 26
  • 1
    Are you sure that the Linux server is running DB2 7.1 on Linux – it has been out of support for nearly 10 years! If this is accurate, the error is most likely coming from the fact that the DB2 9.7 (or 9.5) clients are not compatible with DB2 7.1. – Ian Bjorhovde Jun 04 '12 at 19:25
  • I can confirm that it's running DB2 v7.1. This server is really old (since ~2003). As I know the requirement to use DB2 in the early years of system was set up by the client. Now it has been running fluently for "some time" but needs some maintenance work before the client is willing to pay for upgrade to it's components. I'm trying to get working the development environment for DB but so far without success. So your opinion is that the drivers aren't so UNIVERSAL at all? – vellotis Jun 04 '12 at 21:19
  • IBM states that a particular client will support servers 2 versions back and 1 forward. So, a 9.7 client should support DB2 9.5 and 9.1, as well as DB2 10.1. The "universal" side was more around the fact that one client supports DB2, Informix, Derby. – Ian Bjorhovde Jun 06 '12 at 12:23
  • 1
    Correction: The "universal" name came because the driver supports both type 2 and type 4 JDBC connections. – Ian Bjorhovde Jun 06 '12 at 12:38

2 Answers2

3

You need to locate and use the DB2 7.2 or DB2 7.1 client code (aka DB2 Client Application Enabler). Prior to DB2 8.1, IBM used a different, platform-dependent protocol called DB2RA for communication between the client and server. DB2 8.1 switched to the standard DRDA protocol. DB2 8.x clients could, in specific configurations, talk to DB2 7.x servers.

Alternatively, if you are using a Java application, you could try to locate/use the Type 3 JDBC driver (COM.ibm.db2.jdbc.net.DB2Driver). This driver is clientless (it has a 3-tier architecture, because it requires a so-called "JDBC Applet Server" to be running on the database server. You can see if it's running on your linux box by looking for a process called db2jd. Generally this process will show up as, for example, db2jd 6789, where 6789 is the port number the applet server is listening on. If you don't see this process you can start it (as the DB2 instance owner) by executing the db2jstrt command.

Ian Bjorhovde
  • 10,916
  • 1
  • 28
  • 25
1

Another possibility: You may need to restart the computer. In my case, this worked for me. I got this error after installing a special build of DB2 10.5.

  • For more diagnostics, you can get your IBM JDBC driver version using: java com.ibm.db2.jcc.DB2Jcc -version
  • Or, try: java -cp ./db2jcc.jar com.ibm.db2.jcc.DB2Jcc -version. Then co-relate the driver version to the Db2 version. Link with more details.
SilentSteel
  • 2,344
  • 1
  • 28
  • 28