在使用data studio鏈接遠程DB2數據庫時報錯以下:
[jcc][Thread:main][SQLException@5b775b77] java.sql.SQLException
[jcc][Thread:main][SQLException@5b775b77] SQL state = 08001
[jcc][Thread:main][SQLException@5b775b77] Error code = -4499
[jcc][Thread:main][SQLException@5b775b77] Message = [jcc][t4][2043][11550][4.13.111] 異常 java.net.ConnectException:打開端口 50,000 上服務器 192.168.1.107/192.168.1.107 的套接字時出錯,消息爲:Connection timed out: connect。 ERRORCODE=-4499, SQLSTATE=08001
[jcc][Thread:main][SQLException@5b775b77] Stack trace follows
com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2043][11550][4.13.111] 異常 java.net.ConnectException:打開端口 50,000 上服務器 192.168.1.107/192.168.1.107 的套接字時出錯,消息爲:Connection timed out: connect。 ERRORCODE=-4499, SQLSTATE=08001
com.ibm.db2.jcc.am.id.a(id.java:320)
Cause:
Error 1: DB2 return code is -4499
Four problems might be the cause of this error.
一、
Firewall is not stopped
二、DB2 is stopped.
三、The wrong DB2 database listening port number is specified.
四、The wrong database name is specified.
solution:
一、Check whether firewall is stopped.
chkconfig iptables off 永久性關閉
service iptables stop 重啓主機後失效
二、Check whether DB2 is started.
三、
Check the DB2 listening port
db2 get dbm cfg |grep SVCENAME,查看TCP/IP服務名稱和/etc/services中定義的db2服務名稱是否匹配
四、Check the DB2COMM
db2set -all 檢查DB2COMM是不是TCPIP