473,513 Members | 2,417 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JDBC error

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
1 6179
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3842
by: Benny | last post by:
Dear All, I developed an web application which use MS SQL Server 2000. I encounter the following SQLException "Error setting up static cursor cache". Did anyone encounter this problem before?...
0
1959
by: global | last post by:
Hi, can anyone help me I'm on Linux with UDB Runtime-Client 8.1.4 and try to connect to a windows udb-server 8.1.4 via Websphere and jdbc , and get this error: 3e1a29e5 WebGroup E...
2
9220
by: FX NICOLAS | last post by:
Can anyone help me. I'm trying to retrieve data from DB2/AIX v8.1 using JDBC connectivity (Universal Driver - Type 4 - v1.1.67) . I get a recurrent error (after connection, apparently) : BEGIN...
0
3236
by: Franco Lombardo | last post by:
Hi all, I have a JDBC application that connects to an 8.1.5 WSE on W2k professional. Sometimes it throws this exception: "A connection failed but has been re-established. The hostname or IP...
1
2377
by: Toralf Kirsten | last post by:
Hi, we use DB2 8.1 EEE on a Linux server. We access the db via JDBC provided by IBM with the installation package. When we connect to the db the following first 10 - 12 insert statements are...
2
3428
by: prasath03 | last post by:
Hi, I am using Microsoft SQL Server 2000 Driver for JDBC to connect to SQL Sever 2000. It is just a test application whether its connect or not. But I got the following errors: Error is:...
2
1691
by: kprojects | last post by:
Hello, I'm stuck with the same problem for a few days already. In my applet, in which users can login to see their account details, I want to connect to my databases which is located at localhost....
2
2336
by: kierandes | last post by:
Hi Guy, I am using a JDBC connection to retrieve data and populate datasets. Having some problems with errors: Error: java.sql.SQLException: Invalid cursor state // now we can get...
1
3493
by: ziycon | last post by:
Any ideas with the below error is occuring, can't figure it out at all?
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7539
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5089
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1596
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.