What's your JDBC type?

Article originally posted by Deth

Personally I’m a type 4 kind of guy.
I’ve been debugging a strange JDBC issue with DB2 and NG. When I run a test that uses a JDBC connection to DB2 in Eclipse, it worked but when I run the same test from the command prompt, it failed with the DB2 SQL Error Code -4499.

One of the things I’m doing to figure out this issue is to enable DB2 tracing. Here’s a chunk of code I added to enable tracing. I got this information from http://www.ibm.com/developerworks/db2/library/techarticle/dm-0512kokkat/

dataSource.setTraceLevel(DB2DataSource.TRACE_ALL);
dataSource.setTraceDirectory("D:/tmp");
dataSource.setTraceFile("trace.txt");
dataSource.setTraceFileAppend(true);

The dataSource variable is type com.ibm.db2.jcc.DB2DataSource

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply