IOException: the network adapter could not establish a connection

I am trying to connect to an Oracle database from my Java application. I am using oracle.jdbc.driver.OracleDriver, Version: 0/1 to connect to the database. But DriverManager.getConnection () gives me "The network adapter could not establish a connection." This does not happen in evertime. Sometimes this happens, maybe 8-10 times. Getting a stack trace:

Driver Class : oracle.jdbc.driver.OracleDriver, version 0/1
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3678)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:352)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:365)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:547)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:347)
at java.sql.DriverManager.getConnection(DriverManager.java:316)
at java.sql.DriverManager.getConnection(DriverManager.java:297)

Since I do not receive it every time, I can not guess that there is a connection problem. I see that many developers have the same problem, but for them it happens every time. Please help me, as I am literally stuck in solving this problem.

+3
source share
3

, , :

  • , ? telnet. ?

  • DNS ( IP- , DNS)

  • ? ?

+2

, IP- URL- , .

jdbc:

...(DESCRIPTION=(ADDRESS.....(HOST=1.1.1.1)..)
+2

, ,

at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3678)

IOException. , .

-1

Source: https://habr.com/ru/post/1777010/


All Articles