By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,514 Members | 1,717 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,514 IT Pros & Developers. It's quick & easy.

JDBC error

P: n/a
Hello,

I'm trying to connect to DB2 Express-C for Linux using the JDBC
Universal Driver and I get the error below. I thought it was my code
then I installed Websphere Community Edition 1.0.0.1 and I'm now using
the IBM JDK 1.4.2. I wasn't planning to work directly with Websphere
but just wanted to try a different thing and it gives me exactly the
same error when I try to test the connection pool I created (following
"Kick-start your Java apps: Free software, fast development").

I can connect just fine from the command line either using the
'db2inst1' or my own user (which I've enabled through db2cc).

I've the db2jcc.jar and db2jcc_license_cu.jar files in my classpath.

Searching for this error on Google didn't return anything useful so I'm
posting here. Any direction is highly appreciated. I apologise in
advance if this isn't the right group for this kind of question.

Thank you

Error:

com.ibm.db2.jcc.a.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: null
at com.ibm.db2.jcc.c.gb.l(gb.java:1208)
at com.ibm.db2.jcc.c.gb.c(gb.java:363)
at com.ibm.db2.jcc.c.gb.v(gb.java:1441)
at com.ibm.db2.jcc.c.hb.a(hb.java:43)
at com.ibm.db2.jcc.c.b.e(b.java:1253)
at com.ibm.db2.jcc.c.b.b(b.java:1172)
at com.ibm.db2.jcc.c.b.q(b.java:999)
at com.ibm.db2.jcc.c.b.b(b.java:711)
at com.ibm.db2.jcc.c.b.a(b.java:700)
at com.ibm.db2.jcc.c.b.<init>(b.java:315)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:1 65)
at java.sql.DriverManager.getConnection(DriverManager .java:539)
at java.sql.DriverManager.getConnection(DriverManager .java:158)
at HelloWorld.main(HelloWorld.java:24)

Code:

String dbUsername = "myuser";
String dbPassword = "mypasswd";
String dbAlias = "sample";

String url = "jdbc:db2://localhost:50000/" + dbAlias;
Properties dbProperties = new Properties();
dbProperties.setProperty("user",dbUsername);
dbProperties.setProperty("password",dbPassword);

Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection db2Conn = DriverManager.getConnection(url, dbProperties);

May 7 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
It's almost impossible to tell what's wrong without the full error
message or sqlcode. Check the database server's error logs and the
administration server's logs for additional information. I believe that
you've encountered error SQL30020N - you can look it up in the online
information center.

This code also works fine on my RHEL4, IBM JDK 1.4.2, UDB V8.2 WSE, FP 9

Phil Sherman

Giovanni Tirloni wrote:
Hello,

I'm trying to connect to DB2 Express-C for Linux using the JDBC
Universal Driver and I get the error below. I thought it was my code
then I installed Websphere Community Edition 1.0.0.1 and I'm now using
the IBM JDK 1.4.2. I wasn't planning to work directly with Websphere
but just wanted to try a different thing and it gives me exactly the
same error when I try to test the connection pool I created (following
"Kick-start your Java apps: Free software, fast development").

I can connect just fine from the command line either using the
'db2inst1' or my own user (which I've enabled through db2cc).

I've the db2jcc.jar and db2jcc_license_cu.jar files in my classpath.

Searching for this error on Google didn't return anything useful so I'm
posting here. Any direction is highly appreciated. I apologise in
advance if this isn't the right group for this kind of question.

Thank you

Error:

com.ibm.db2.jcc.a.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: null
at com.ibm.db2.jcc.c.gb.l(gb.java:1208)
at com.ibm.db2.jcc.c.gb.c(gb.java:363)
at com.ibm.db2.jcc.c.gb.v(gb.java:1441)
at com.ibm.db2.jcc.c.hb.a(hb.java:43)
at com.ibm.db2.jcc.c.b.e(b.java:1253)
at com.ibm.db2.jcc.c.b.b(b.java:1172)
at com.ibm.db2.jcc.c.b.q(b.java:999)
at com.ibm.db2.jcc.c.b.b(b.java:711)
at com.ibm.db2.jcc.c.b.a(b.java:700)
at com.ibm.db2.jcc.c.b.<init>(b.java:315)
at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:1 65)
at java.sql.DriverManager.getConnection(DriverManager .java:539)
at java.sql.DriverManager.getConnection(DriverManager .java:158)
at HelloWorld.main(HelloWorld.java:24)

Code:

String dbUsername = "myuser";
String dbPassword = "mypasswd";
String dbAlias = "sample";

String url = "jdbc:db2://localhost:50000/" + dbAlias;
Properties dbProperties = new Properties();
dbProperties.setProperty("user",dbUsername);
dbProperties.setProperty("password",dbPassword);

Class.forName("com.ibm.db2.jcc.DB2Driver");
Connection db2Conn = DriverManager.getConnection(url, dbProperties);

May 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.