DB2 jdbc connection error Connection refused. ERRORCODE=-4499, SQLSTATE=08001(DB2 jdbc 连接错误连接被拒绝.错误代码=-4499,SQLSTATE=08001)
问题描述
我有一个新的DB2服务器(v10.5.0.3),我可以在本地连接到数据库就好了.
I have a new DB2 server (v10.5.0.3), and I can connect to the database locally just fine.
尝试使用 JDBC 从远程服务器连接时,我收到连接被拒绝.ERRORCODE=-4499, SQLSTATE=08001"错误.基于此处找到的信息 https://www-304.ibm.com/support/docview.wss?uid=swg21403644 我已经确认了
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
我已经验证了两台服务器上的防火墙都打开了端口 50000 和 50001.我的想法已经用完了,非常感谢任何帮助.
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.
推荐答案
我也遇到了同样的问题...是IPV6引起的...指向 localhost 的 URL 连接点,解析为 ::1(localhost 的 IPV6 地址),并且 DB2 服务器没有列出 IPV6 协议.
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.
我通过修改 c:windowssystem32driveretchost 文件来解决:我取消注释 127.0.0.1 locahost 行以强制 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.
我希望这会有所帮助.(对不起我的英语)
这篇关于DB2 jdbc 连接错误连接被拒绝.错误代码=-4499,SQLSTATE=08001的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:DB2 jdbc 连接错误连接被拒绝.错误代码=-4499,SQLSTATE=08001
基础教程推荐
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 降序排序:Java Map 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01