Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2005
    Posts
    2

    Unanswered: 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

  2. #2
    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 !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •