DB2 jdbc connection error Connection refused. ERRORCODE=-4499, SQLSTATE=08001
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.
I resolved by modify the c:\windows\system32\driver\etc\host file : I uncomment the line 127.0.0.1 locahost to force ipv4 resolution name of locahost... and it's works.
I hope that helps. (sorry for my English)
Mike Storey
I have a broad background in IT, and speak many programming languages. I think I'm a pretty good programmer, but I'm really just a hack.... I'm much better at making Gigapixel Photographs of beautiful places: See My Web-Site www.ssgpp.com
Updated on December 22, 2020Comments
-
Mike Storey over 3 years
I have a new DB2 server (v10.5.0.3), and I can connect to the database locally just fine.
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
and
[db2inst1@db2 ~]$ db2 get database manager configuration | grep -i svce TCP/IP Service name (SVCENAME) = 50001 SSL service name (SSL_SVCENAME) =
with these JDBC connection values
driver=com.ibm.db2.jcc.DB2Driver url=jdbc:db2://db2.xxxxx.com:50001/TESTGEN username=XXXXXXXX password=XXXXXXX
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.
-
user207421 over 8 yearsTelnet has nothing to do with it. The DB2 process wasn't running.
-
AngocA over 8 yearsWhat you mean is to test the port if it is open: telnet IPserver DB2port, telnet 192.168.0.1 50000