title: Connection to remote db2 database through JDBC fails
body: <p>I am new to db2. I want to ask if it is possible to just connect to a db2 database on a remote db2 server through my java application? Merely having jdbc driver of type 4?</p>
  
  <p>I am having db2jcc4 driver on build path.</p>
  
  <p>When I try this simple code </p>
  
  <pre><code> public static void main(String[] args) {
          Class.forName("com.ibm.db2.jcc.DB2Driver");
          System.out.println("Driver loaded");
  
          try {
              Connection dbConn =     DriverManager.getConnection("jdbc:db2://192.168.0.103:50000/ABC", "****", "*****");
          } catch (SQLException e) {
              e.printStackTrace();
          }
  
  }
  </code></pre>
  
  <p>Connection fails with this exception. I am unable to trace what is exactly happening?</p>
  
  <pre><code> com.ibm.db2.jcc.am.SqlException: [jcc][t4][10262][11223][4.19.26] Unexpected Throwable caught: null. ERRORCODE=-4228, SQLSTATE=null
  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.am.kd.a(Unknown Source)
  at com.ibm.db2.jcc.t4.b.b(Unknown Source)
  at com.ibm.db2.jcc.t4.b.a(Unknown Source)
  at com.ibm.db2.jcc.t4.b.a(Unknown Source)
  at com.ibm.db2.jcc.t4.b.a(Unknown Source)
  at com.ibm.db2.jcc.t4.b.&lt;init&gt;(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 com.connect.db2.ConnectToServer.main(ConnectToServer.java:22)
  
  
   Caused by: java.lang.NullPointerException
  at com.ibm.db2.jcc.am.Connection.completeSqlca(Unknown Source)
  at com.ibm.db2.jcc.t4.z.q(Unknown Source)
  at com.ibm.db2.jcc.t4.z.p(Unknown Source)
  at com.ibm.db2.jcc.t4.z.l(Unknown Source)
  at com.ibm.db2.jcc.t4.z.d(Unknown Source)
  at com.ibm.db2.jcc.t4.b.k(Unknown Source)
  at com.ibm.db2.jcc.t4.b.b(Unknown Source)
  at com.ibm.db2.jcc.t4.b.a(Unknown Source)
  ... 12 more
  </code></pre>
  
  <p>Also the db2diag.log after getconnection is :</p>
  
  <pre><code> PID     : 5110                 TID : 140245920114432 PROC : db2sysc 0
   INSTANCE: sachindb             NODE : 000            DB   : ABC
   APPHDL  : 0-46                 APPID: 192.168.0.101.64054.151230182945
   AUTHID  : SACHINDB             HOSTNAME: Sachin
   EDUID   : 22                   EDUNAME: db2agent (ABC) 0
   FUNCTION: DB2 UDB, base sys utilities, sqleIsDatabaseDirectoryConnectable, probe:6835
   MESSAGE : ZRC=0x8005006D=-2147155859=SQLE_CA_BUILT
        "SQLCA has been built and saved in component specific control   block."
   DATA #1 : SQLCA, PD_DB2_TYPE_SQLCA, 136 bytes
   sqlcaid : SQLCA     sqlcabc: 136   sqlcode: -1035   sqlerrml: 0
   sqlerrmc: 
   sqlerrp : SQLE534 
   sqlerrd : (1) 0x00000000      (2) 0x00000000      (3) 0x00000000
         (4) 0x00000000      (5) 0x00000000      (6) 0x00000000
   sqlwarn : (1)      (2)      (3)      (4)        (5)       (6)    
         (7)      (8)      (9)      (10)        (11)     
   sqlstate:      
  </code></pre>