If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > No Connection to DB with JDBC

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-14-05, 04:41
brodmi brodmi is offline
Registered User
 
Join Date: Oct 2005
Posts: 2
No Connection to DB with JDBC

Hi,

I try to connect a DB2 DB.
The driver db2java.zip works fine, but when i try to connect with

Class.forName("COM.ibm.db2.jdbc.net.DB2Driver").ne wInstance();

String databaseUrl = "jdbc:db2://SERVER:6789/DATABASE";
java.sql.Connection con = java.sql.DriverManager.getConnection(databaseUrl, "user", "password");

then i get the following error :
java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutp utStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStre am.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedO utputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputS tream.java:123)
at java.io.DataOutputStream.flush(DataOutputStream.ja va:106)
at COM.ibm.db2.jdbc.net.DB2Request.send(DB2Request.ja va:531)
at COM.ibm.db2.jdbc.net.DB2Connection.close(DB2Connec tion.java:616)
at COM.ibm.db2.jdbc.net.DB2Connection.SQLConnect(DB2C onnection.java:328)
at COM.ibm.db2.jdbc.net.DB2Connection.create(DB2Conne ction.java:241)
at COM.ibm.db2.jdbc.net.DB2Connection.<init>(DB2Conne ction.java:161)
at COM.ibm.db2.jdbc.net.DB2Driver.connect(DB2Driver.j ava:189)
at java.sql.DriverManager.getConnection(DriverManager .java:525)
at java.sql.DriverManager.getConnection(DriverManager .java:171)
at persistent.DataAccessDB2.main(DataAccessDB2.java:1 8)
COM.ibm.db2.jdbc.net.DB2Exception: [IBM][JDBC Driver] CLI0617E Error closing socket. SQLSTATE=08S01
at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.socketE xception(SQLExceptionGenerator.java:521)
at COM.ibm.db2.jdbc.net.DB2Connection.close(DB2Connec tion.java:634)


When I check the Server and ports then it looks fine to me ->
netstat -na
TCP 0.0.0.0:6789 LISTENING.

There is no firewall between my Compter and the DB2-Server.
I can connect the Server with DB2CMD

Do I have to configure somthing i havn't thought about?
Please help
Reply With Quote
  #2 (permalink)  
Old 10-14-05, 08:34
brodmi brodmi is offline
Registered User
 
Join Date: Oct 2005
Posts: 2
I solved the Problem..
My Driver db2java.zip was an old Version from 1999.
With the new Driver from 2002 it works fine !
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On