3

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.

Mike Storey
  • 1,029
  • 3
  • 11
  • 21
  • It's a network error, not DB2. Use `netstat -ap | grep db2sysc` or similar on the server to verify that the instance is indeed listening on the port you think it does, and `telnet serverhost 50001` on the client to confirm that you can connect. – mustaccio Aug 29 '15 at 19:21
  • I'm not ruling out a network problem, but I'm still stumped. netstat shows db2 listening on 50001, and telnet dbserver 50001 results in a Connection Refused error, even from dbserver locally. Both servers are on the same sub-net and both have port 50001 open on the firewall. It seems as though db2 is refusing the connection. – Mike Storey Aug 29 '15 at 20:35
  • 1
    If DB2 is refusing the connection there should be something in the db2diag.log. If it is not, then it is the network alone. – data_henrik Aug 30 '15 at 07:46
  • Can you just try to disable the firewall completely? – Giorgi Tsiklauri Aug 23 '20 at 19:13

3 Answers3

1

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)

0

It was indeed a network error. I'm not fully sure which fix was the most important but I made sure telnet was enabled and white listed the DB2 process in the RHEL firewall configuration.

Mike Storey
  • 1,029
  • 3
  • 11
  • 21
0

I had same problem, when I couldn't connect to my remote database with Data Studio Client and with DB2 CLP console. Make sure that you checked ping to your server and it is successful, you checked dbm cfg and you know svcename, tcpip port number, you checked ..System32\drivers\etc\services file and there is "svcename tcpip_port_number/tcp" in that file. So, while you get message in your db2diag.log ""TCPIP" protocol support was successfully started.", it isn't network problem. I opened ports on my server mashine: DB2 server tcpip port(svcename) and DB2 DAS tcpip port through the Firewall settings. I found help on this reference https://learn.microsoft.com/en-us/sql/reporting-services/report-server/configure-a-firewall-for-report-server-access?view=sql-server-ver16. Be careful and consult with your system admin about security.

(Sorry for my English)))