問(wèn)題描述
我有一個(gè)新的DB2服務(wù)器(v10.5.0.3),我可以在本地連接到數(shù)據(jù)庫(kù)就好了.
I have a new DB2 server (v10.5.0.3), and I can connect to the database locally just fine.
嘗試使用 JDBC 從遠(yuǎn)程服務(wù)器連接時(shí),我收到連接被拒絕.ERRORCODE=-4499, SQLSTATE=08001"錯(cuò)誤.基于此處找到的信息 https://www-304.ibm.com/support/docview.wss?uid=swg21403644 我已經(jīng)確認(rèn)了
When trying to connect from a remote server using JDBC I am getting the "Connection refused. ERRORCODE=-4499, SQLSTATE=08001" error. Based on information found here https://www-304.ibm.com/support/docview.wss?uid=swg21403644 I have confirmed that
[db2inst1@db2 ~]$ db2set -all
[i] DB2COMM=TCPIP
[i] DB2AUTOSTART=YES
[g] DB2SYSTEM=db2.xxxx.com
[g] DB2INSTDEF=db2inst1
[g] DB2ADMINSERVER=xxxxxx
和
[db2inst1@db2 ~]$ db2 get database manager configuration | grep -i svce
TCP/IP Service name (SVCENAME) = 50001
SSL service name (SSL_SVCENAME) =
使用這些 JDBC 連接值
with these JDBC connection values
driver=com.ibm.db2.jcc.DB2Driver
url=jdbc:db2://db2.xxxxx.com:50001/TESTGEN
username=XXXXXXXX
password=XXXXXXX
我已經(jīng)驗(yàn)證了兩臺(tái)服務(wù)器上的防火墻都打開(kāi)了端口 50000 和 50001.我的想法已經(jīng)用完了,非常感謝任何幫助.
I have verified that the firewall on the both servers have opened ports 50000 and 50001. I've run out of ideas, any help is greatly appreciated.
推薦答案
我也遇到了同樣的問(wèn)題...是IPV6引起的...指向 localhost 的 URL 連接點(diǎn),解析為 ::1(localhost 的 IPV6 地址),并且 DB2 服務(wù)器沒(méi)有列出 IPV6 協(xié)議.
I had the same trouble... Its was caused by IPV6... The URL connection point to localhost, resolved as ::1 (the IPV6 address of localhost) and DB2 server doens't listing IPV6 protocol.
我通過(guò)修改 c:windowssystem32driveretchost 文件來(lái)解決:我取消注釋 127.0.0.1 locahost 行以強(qiáng)制 locahost 的 ipv4 解析名稱...并且它有效.
I resolved by modify the c:windowssystem32driveretchost file : I uncomment the line 127.0.0.1 locahost to force ipv4 resolution name of locahost... and it's works.
我希望這會(huì)有所幫助.(對(duì)不起我的英語(yǔ))
這篇關(guān)于DB2 jdbc 連接錯(cuò)誤連接被拒絕.錯(cuò)誤代碼=-4499,SQLSTATE=08001的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!