title: Unable to get oracle database connection
body: <p>1.JAVA_HOME is set to IBM JAVA SDK.
  2.Unable to get oracle database connection. Where as tried running the same on machine having Oracle java set as JAVA_HOME
  3.Placed ojdbc14.jar under AppServer/lib.</p>
  <pre><code>   try {
  
    connection = DriverManager.getConnection(
        &quot;jdbc:oracle:thin:@[server-ip]:[server-port]/[dbname]&quot;, &quot;[uname]&quot;, &quot;[pass]&quot;);
  
  } catch (SQLException e) {
  
    System.out.println(&quot;Connection Failed! Check output console&quot;);
    e.printStackTrace();
    return;
  
  }
  
  if (connection != null) {
    System.out.println(&quot;You made it, take control your database now!&quot;);
  } else {
    System.out.println(&quot;Failed to make connection!&quot;);
  }
  </code></pre>
  <p>Is there any setting i need to do.Below is the error</p>
  <blockquote>
  <p>Oracle JDBC Driver Registered! Connection Failed! Check output console
  java.sql.SQLRecoverableException: IO Error: The Network Adapter could
  not establish the connection
  at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:517)
  at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:557)
  at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:233)
  at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:29)
  at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:556)
  at java.sql.DriverManager.getConnection(DriverManager.java:583)
  at java.sql.DriverManager.getConnection(DriverManager.java:227)
  at OracleJDBCExample.main(OracleJDBCExample.java:29) Caused by: oracle.net.ns.NetException: The Network Adapter could not
  establish the connection
  at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:389)
  at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:431)
  at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:882)
  at oracle.net.ns.NSProtocol.connect(NSProtocol.java:267)
  at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1625)
  at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:365)
  ... 7 more Caused by: java.net.SocketTimeoutException: connect timed out
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:370)
  at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:231)
  at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:213)
  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:404)
  at java.net.Socket.connect(Socket.java:643)
  at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:147)
  at oracle.net.nt.ConnOption.connect(ConnOption.java:130)
  at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:367)</p>
  </blockquote>
  <p>Thanks,
  Kusuma</p>