简体   繁体   中英

got error “java.sql.SQLRecoverableException: IO Error: Socket read timed out” in intellij

I'm getting an error in IntelliJ IDEA when im using a thin connection from java to oracle.

My oracle database is in a server and I can ping the server but my code can't establish connection:

        Class.forName("oracle.jdbc.driver.OracleDriver");
        connection = DriverManager.getConnection("jdbc:oracle:thin:@server ip:1521:orcl","user","path");
        System.out.println("Oracle Registered...");

and error is:

java.sql.SQLRecoverableException: IO Error: Socket read timed out
oracle.net.ns.NetException: Socket read timed out

It is possible that the network is reachable but the operations take too much time.

Check if you can establish a connection using a standard db client like toad, sql server or squirrel.

If you can use the same paramters in java and it should work.

If you can't check if another process is using port 1521 on the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM