title: I am getting " Operation timed out. ERRORCODE=-4499, SQLSTATE=08001" connecting to remote DB2
body: <p>I am attempting to connect to a remote DB2 using IBM Type 4 JDBC driver.
  Here is my configuration:</p>
  
  <p>Server:</p>
  
  <ul>
  <li>Windows 7 professional</li>
  <li>DB2 LUW V10.5</li>
  <li>DB2 SVCENAME=50000</li>
  <li>TCP/IP to communicate</li>
  </ul>
  
  <p>Client:</p>
  
  <ul>
  <li>OS/x V10.10.3</li>
  <li>Eclipse Mars</li>
  <li>IBM DB2 Java Type 4 drivers</li>
  </ul>
  
  <p>It is my understanding that if you write the client app in Java and use the type 4—pure Java—drivers, the client doesn't have to have a client installed.  The app will use DRDA to connect directly to the remote database.</p>
  
  <p>Here is a snippet of code that I tried to access the remote db2:</p>
  
  <pre><code>public class BlobRetrieval {
  
      static String databaseDriver;
      static String dbURL;
      static String userName;
      static String password;
      static Connection passConn; 
  
  public static void main(String[] args) {        
      databaseDriver = "com.ibm.db2.jcc.DB2Driver";
      dbURL = "jdbc:db2://192.168.1.81:50000/LOBDB";
      userName = "ace";
      password = "ace";
      try {
          Class.forName(databaseDriver).newInstance();
          System.out.println("register successful");
          Connection connection = DriverManager.getConnection(dbURL, userName, password);
          System.out.println("connection successful");
          passConn = connection;
          PreparedStatement preparedStatement=connection.prepareStatement("SELECT BOOKCOVER FROM BOOKCOVERS WHERE BOOKISBN=?");
          preparedStatement.setString(1, "0738425826");
      }
  }
  </code></pre>
  
  <p>When I execute these statements, I get the following error:</p>
  
  <blockquote>
    <p>register successful
        com.ibm.db2.jcc.am.DisconnectNonTransientConnectionException: [jcc][t4][2043][11550]     [4.19.26] Exception
    java.net.ConnectException: Error opening socket to server
    /192.168.1.81 on port 50,000 with message: Operation timed out.
    ERRORCODE=-4499, SQLSTATE=08001
         at com.ibm.db2.jcc.am.kd.a(Unknown Source)
         at com.ibm.db2.jcc.am.kd.a(Unknown Source)
         at com.ibm.db2.jcc.t4.ac.a(Unknown Source)
         at com.ibm.db2.jcc.t4.ac.(Unknown Source)
         at com.ibm.db2.jcc.t4.a.b(Unknown Source)
         at com.ibm.db2.jcc.t4.b.newAgent_(Unknown Source)
         at com.ibm.db2.jcc.am.Connection.initConnection(Unknown Source)
         at com.ibm.db2.jcc.am.Connection.(Unknown Source)
         at com.ibm.db2.jcc.t4.b.(Unknown Source)
         at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(Unknown Source)
         at com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(Unknown Source)
         at com.ibm.db2.jcc.DB2Driver.connect(Unknown Source)
         at com.ibm.db2.jcc.DB2Driver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(DriverManager.java:664)
         at java.sql.DriverManager.getConnection(DriverManager.java:247)
         at dbAccessPackage.BlobRetrieval.main(BlobRetrieval.java:30)
         Caused by: java.net.ConnectException: Operation timed out
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
         at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
         at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
         at java.net.Socket.connect(Socket.java:589)
         at com.ibm.db2.jcc.t4.w.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)</p>
  </blockquote>