访问DB2/NT 6.1服务器端数据库连接报错,求大神解求

DB2版本:DB2/NT 6.1
JDBC代码:
Class.forName("COM.ibm.db2.jdbc.net.DB2Driver").newInstance();
Connection conn = DriverManager.getConnection("jdbc:db2://170.111.xxx.xxx:50000/xxxxx","xxxx", "xxxx");

控制台报错:
COM.ibm.db2.jdbc.net.DB2Exception: [IBM][JDBC Driver] CLI0615E 从套接字接收时出错,服务器不响应。SQLSTATE=08S01
at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.throwReceiveError(SQLExceptionGenerator.java:403)
at COM.ibm.db2.jdbc.net.DB2Request.receive(DB2Request.java:655)
at COM.ibm.db2.jdbc.net.DB2Request.sendAndRecv(DB2Request.java:518)
at COM.ibm.db2.jdbc.net.DB2Connection.SQLConnect(DB2Connection.java:274)
at COM.ibm.db2.jdbc.net.DB2Connection.create(DB2Connection.java:233)
at COM.ibm.db2.jdbc.net.DB2Connection.(DB2Connection.java:161)
at COM.ibm.db2.jdbc.net.DB2Driver.connect(DB2Driver.java:191)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.xiaojd.test.TestDB2Jdbc.getConnection(TestDB2Jdbc.java:53)
at com.xiaojd.test.TestDB2Jdbc.queryTable(TestDB2Jdbc.java:19)
at com.xiaojd.test.TestDB2Jdbc.main(TestDB2Jdbc.java:14)
Exception in thread "main" java.lang.NullPointerException
at com.xiaojd.test.TestDB2Jdbc.queryTable(TestDB2Jdbc.java:23)
at com.xiaojd.test.TestDB2Jdbc.main(TestDB2Jdbc.java:14)

2个回答

看下放火墙和网络连接是否正确。

DB2的被屏蔽了。FireWall打开一下

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐