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 / June 2005

Tip: Looking for answers? Try searching our database.

Problems with Type 4 jdbc driver

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
deegs_ca@yahoo.com - 23 Jun 2005 08:03 GMT
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:165)

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.
Ian - 23 Jun 2005 18:53 GMT
> 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
[quoted text clipped - 12 lines]
> 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.
deegs_ca@yahoo.com - 24 Jun 2005 01:12 GMT
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?
Ian - 24 Jun 2005 03:00 GMT
> Type 4 driver does  not want to work.  What am I missing?
>
[quoted text clipped - 4 lines]
> 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.
deegs_ca@yahoo.com - 28 Jun 2005 00:21 GMT
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?
Knut Stolze - 28 Jun 2005 09:35 GMT
> 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.

Signature

Knut Stolze
Information Integration Development
IBM Germany / University of Jena

deegs_ca@yahoo.com - 28 Jun 2005 15:15 GMT
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)
Ian - 28 Jun 2005 15:40 GMT
> 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
>
[quoted text clipped - 5 lines]
>         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'
Knut Stolze - 28 Jun 2005 18:49 GMT
> yes,  I've done that.   :)  unfortunately with no luck.
>
[quoted text clipped - 10 lines]
>         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.

Signature

Knut Stolze
Information Integration Development
IBM Germany / University of Jena

 
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



©2008 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.