Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / May 2006

Tip: Looking for answers? Try searching our database.

JDBC error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Giovanni Tirloni - 07 May 2006 02:30 GMT
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:165)
       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);
Phil Sherman - 07 May 2006 07:04 GMT
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

> Hello,
>
[quoted text clipped - 51 lines]
> Class.forName("com.ibm.db2.jcc.DB2Driver");
> Connection db2Conn = DriverManager.getConnection(url, dbProperties);
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.