0

There seems to be an issue with Centos7 and the ojdbc6 driver that is used for Oracle connections. The connection hangs and or fails resulting in a timeout. The following is the simplest program I could derive to show this issue:

import java.sql.*;
public class Test{  
    public static void main(String[] args){
        try{
          Class.forName("oracle.jdbc.OracleDriver"):
        }catch(ClassNotFoundException e){System.out.println(e);}    
       Connection conn = null;
       try{
           conn = DriverManager.getConnection(...);
       }catch(SQLException e){System.out.println(e);}
    }
}

The odd thing is this code executes perfectly fine on Centos6.

Woot4Moo
  • 23,987
  • 16
  • 94
  • 151

1 Answers1

2

I don't think the JDBC drivers are operating system-dependent. However, for the issue you are facing, you can try setting the JVM property like this:

-Djava.security.egd=file:///dev/urandom

Please refer to this issue Oracle JDBC intermittent Connection Issue.

The issue on connection timeout and its relation with server randomness is mentioned in details there.

mustaccio
  • 18,234
  • 16
  • 48
  • 57
Sandeep Salian
  • 341
  • 2
  • 8