Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get JDBC to work with DB2 using jdbc:db2:<database>

Status
Not open for further replies.

cpjust

Programmer
Sep 23, 2003
2,132
US
Hi,
I have a Java application that works fine when using a JDBC URL like this:
jdbc:db2://host:port/database
but when I change it to use this format:
jdbc:db2:database
I get the following error:

Code:
WARNING: Failed to execute: select distinct tabschema from syscat.tables because: Execution failed due to a distribution protocol error that caused deallocation of the conversation.  A DRDA Data Stream Syntax Error was detected.  Reason: 0x3  DB2ConnectionCorrelator: *LOCAL.db2inst1.100917205438
com.ibm.db2.jcc.b.DisconnectException: Execution failed due to a distribution protocol error that caused deallocation of the conversation.  A DRDA Data Stream Syntax Error was detected.  Reason: 0x3  DB2ConnectionCorrelator: *LOCAL.db2inst1.100917205438
Debug Stack Trace:
com.ibm.db2.jcc.b.DisconnectException: Execution failed due to a distribution protocol error that caused deallocation of the conversation.  A DRDA Data Stream Syntax Error was detected.  Reason: 0x3  DB2ConnectionCorrelator: *LOCAL.db2inst1.100917205438
com.ibm.db2.jcc.b.DisconnectException: Execution failed due to a distribution protocol error that caused deallocation of the conversation.  A DRDA Data Stream Syntax Error was detected.  Reason: 0x3  DB2ConnectionCorrelator: *LOCAL.db2inst1.100917205438
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

I'm using DB2 Express-C 9.7.2 on Ubuntu Linux.
Any ideas on what the problem might be?
 
Nevermind. I finally got it to work.
Apparently the db2jcc drivers I had in my classpath (which worked fine with Type 4 JDBC URLs) don't work with Type 2 JDBC URLs. When I added the db2jcc drivers from my DB2 Express-C to my classpath it worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top