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

Problems with Type 4 jdbc driver

P: n/a
So I had my jdbc db28.2 fix pack 9 client running because I had taken
the jars from <DB2ROOT>/java folder from Enterprise Edition 8.2 fix
pack 9, db2java.zip, db2jcc.zip, and the license jar. Using these
everything works.

But then I wanted to make sure that I was using the redistributable
jars (type 4 ) available from ibm.com. So I downloaded them from ibm.
But they blow up in my face....

I'm using db2jcc.jar and the license file from the type 4 driver
downloadable from IBM included in the zip "db2_jdbc_t4.zip"

I'm on win xp. Here's my jdbc info

jdbc url - jdbc:db2://localhost:6789/TESTDB
driver used com.ibm.db2.jcc.DB2Driver

I get the following stacktrace

[java] Caused by: com.ibm.db2.jcc.b.DisconnectException: A
communication er
ror has been detected. Communication protocol being used: Reply.fill().
Communic
ation API being used: InputStream.read(). Location where the error was
detected:
Connection reset. Communication function detecting the error: *.
Protocol speci
fic error codes(s) TCP/IP SOCKETS DB2ConnectionCorrelator: null
[java] at com.ibm.db2.jcc.c.a.a(a.java:374)
[java] at com.ibm.db2.jcc.c.cb.b(cb.java:175)
[java] at com.ibm.db2.jcc.c.cb.c(cb.java:222)
[java] at com.ibm.db2.jcc.c.cb.c(cb.java:337)
[java] at com.ibm.db2.jcc.c.cb.v(cb.java:1439)
[java] at com.ibm.db2.jcc.c.db.a(db.java:42)
[java] at com.ibm.db2.jcc.c.b.e(b.java:1165)
[java] at com.ibm.db2.jcc.c.b.b(b.java:1090)
[java] at com.ibm.db2.jcc.c.b.q(b.java:925)
[java] at com.ibm.db2.jcc.c.b.a(b.java:665)
[java] at com.ibm.db2.jcc.c.b.a(b.java:654)
[java] at com.ibm.db2.jcc.c.b.<init>(b.java:293)
[java] at
com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:1 65)

I also get the following line in my db2diag.log

Anyone know what's wrong?

If the jars which get installed with the database in the DB2/java
folder are redistributable then I'm golden. For that I use the
following net driver and it now seems to work fine.

COM.ibm.db2.jdbc.net.DB2Driver

thanks.

Nov 12 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Ian
de******@yahoo.com wrote:
So I had my jdbc db28.2 fix pack 9 client running because I had taken
the jars from <DB2ROOT>/java folder from Enterprise Edition 8.2 fix
pack 9, db2java.zip, db2jcc.zip, and the license jar. Using these
everything works.

But then I wanted to make sure that I was using the redistributable
jars (type 4 ) available from ibm.com. So I downloaded them from ibm.
But they blow up in my face....

I'm using db2jcc.jar and the license file from the type 4 driver
downloadable from IBM included in the zip "db2_jdbc_t4.zip"

I'm on win xp. Here's my jdbc info

jdbc url - jdbc:db2://localhost:6789/TESTDB
driver used com.ibm.db2.jcc.DB2Driver


6789 is the default port for the type 3 driver - for the Type 4 JCC
driver you must specify the port that the DB2 instance listens on.

The default for this is 50000, but you can check the 'SVCENAME' database
manager config parameter to verify.

Nov 12 '05 #2

P: n/a
Type 4 driver does not want to work. What am I missing?

I start a listener by typing db2jstrt <portnumber>

and then I try to connect to it.

Have you successfully used the type 4 driver? If so can you provide
details?

Nov 12 '05 #3

P: n/a
Ian
de******@yahoo.com wrote:
Type 4 driver does not want to work. What am I missing?

I start a listener by typing db2jstrt <portnumber>

and then I try to connect to it.

Have you successfully used the type 4 driver? If so can you provide
details?


The JDBC listener (db2jd, which is started with db2jstrt) is for the
Type 3 driver only.

The type 4 driver has a URL like,

jdbc:db2://db2server.yoursite.com:50000/SAMPLE

50000 is the port that the DB2 instance listens on (i.e. SVCENAME
database manager config param), and SAMPLE is the name of the database.

There are samples in sqllib/samples/java/jdbc that show how to do this.


Nov 12 '05 #4

P: n/a
This is exactly what I've done. It seems that my Db2 server must be
configured incorrectly. I've used the configuration assistant to
enable TCPIP and pointed it to the correct service name and port 60000
(in my case).

Any thoughts on how to enable a DB2 server to accept type 4 driver
communications?

Nov 12 '05 #5

P: n/a
de******@yahoo.com wrote:
This is exactly what I've done. It seems that my Db2 server must be
configured incorrectly. I've used the configuration assistant to
enable TCPIP and pointed it to the correct service name and port 60000
(in my case).


Have you set the DB2 registry variable DB2COMM properly to tell DB2 to
start-up TCP/IP protocol? To do that, issue:

$ db2set DB2COMM=tcpip

Then verify the setting of the SVCENAME database manager configuration
parameter, and if that's a symbolic name, verify that this name is assigned
a numerical value in your "services" file (/etc/services on Unix).

Once this is set properly, restart your DB2 instance.

--
Knut Stolze
Information Integration Development
IBM Germany / University of Jena
Nov 12 '05 #6

P: n/a
yes, I've done that. :) unfortunately with no luck.

Do you know what the DB2 java enablement program is and where I can
find it? Some of the sample say I must install this?
Current error I'm getting

Exception in thread "main" com.ibm.db2.jcc.b.SqlException: DB2 SQL
error: SQLCOD
E: -30081, SQLSTATE: 08001, SQLERRMC:
10053;*;*;TCP/IP;SOCKETS;127.0.0.1;recv;
at com.ibm.db2.jcc.b.o.a(o.java:3467)
at com.ibm.db2.jcc.c.db.q(db.java:734)
at com.ibm.db2.jcc.c.db.n(db.java:575)

Nov 12 '05 #7

P: n/a
Ian
de******@yahoo.com wrote:
yes, I've done that. :) unfortunately with no luck.

Do you know what the DB2 java enablement program is and where I can
find it? Some of the sample say I must install this?
If you're running the java app on your server (I assume that's the
case because you are using 127.0.0.1), then you've got everything
you need.

Current error I'm getting

Exception in thread "main" com.ibm.db2.jcc.b.SqlException: DB2 SQL
error: SQLCOD
E: -30081, SQLSTATE: 08001, SQLERRMC:
10053;*;*;TCP/IP;SOCKETS;127.0.0.1;recv;
at com.ibm.db2.jcc.b.o.a(o.java:3467)
at com.ibm.db2.jcc.c.db.q(db.java:734)
at com.ibm.db2.jcc.c.db.n(db.java:575)


This is a generic TCPIP error. Can you post your database manager
configuration (db2 get dbm cfg), /etc/services file and output from
'db2set'
Nov 12 '05 #8

P: n/a
de******@yahoo.com wrote:
yes, I've done that. :) unfortunately with no luck.

Do you know what the DB2 java enablement program is and where I can
find it? Some of the sample say I must install this?
Current error I'm getting

Exception in thread "main" com.ibm.db2.jcc.b.SqlException: DB2 SQL
error: SQLCOD
E: -30081, SQLSTATE: 08001, SQLERRMC:
10053;*;*;TCP/IP;SOCKETS;127.0.0.1;recv;
at com.ibm.db2.jcc.b.o.a(o.java:3467)
at com.ibm.db2.jcc.c.db.q(db.java:734)
at com.ibm.db2.jcc.c.db.n(db.java:575)


With being local, you should try to catalog the database via tcp/ip and then
connect to it.

$ db2 catalog tcpip node local remote localhost server <db2-port-number>
$ db2 catalog db sample as test at node local
$ db2 connect to test user <login> using <password>

If that doesn't work, then you have some problem with your network setup on
the machine (firewall?) that needs to be sorted out first.

--
Knut Stolze
Information Integration Development
IBM Germany / University of Jena
Nov 12 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.