title: DB2 jdbc connection error Connection refused. ERRORCODE=-4499, SQLSTATE=08001
body: <p>I have a new DB2 server (v10.5.0.3), and I can connect to the database locally just fine.</p>
  
  <p>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 <a href="https://www-304.ibm.com/support/docview.wss?uid=swg21403644" rel="nofollow">https://www-304.ibm.com/support/docview.wss?uid=swg21403644</a> I have confirmed that </p>
  
  <pre><code>[db2inst1@db2 ~]$ db2set -all
  [i] DB2COMM=TCPIP
  [i] DB2AUTOSTART=YES
  [g] DB2SYSTEM=db2.xxxx.com
  [g] DB2INSTDEF=db2inst1
  [g] DB2ADMINSERVER=xxxxxx
  </code></pre>
  
  <p>and </p>
  
  <pre><code>[db2inst1@db2 ~]$ db2 get database manager configuration | grep -i svce
   TCP/IP Service name                          (SVCENAME) = 50001
   SSL service name                         (SSL_SVCENAME) = 
  </code></pre>
  
  <p>with these JDBC connection values</p>
  
  <pre><code>driver=com.ibm.db2.jcc.DB2Driver
  url=jdbc:db2://db2.xxxxx.com:50001/TESTGEN
  username=XXXXXXXX
  password=XXXXXXX
  </code></pre>
  
  <p>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.</p>