Oracle Connection IO exception:the network Adapter could not

Source: Internet
Author: User

Specific error

Java.sql.SQLRecoverableException:Io exception: The network Adapter could not establish the connection
At Oracle.jdbc.driver.SQLStateMapping.newSQLException (sqlstatemapping.java:101)
At Oracle.jdbc.driver.DatabaseError.newSQLException (databaseerror.java:112)
At Oracle.jdbc.driver.DatabaseError.throwSqlException (databaseerror.java:173)
At Oracle.jdbc.driver.DatabaseError.throwSqlException (databaseerror.java:229)
At Oracle.jdbc.driver.DatabaseError.throwSqlException (databaseerror.java:458)
At Oracle.jdbc.driver.T4CConnection.logon (t4cconnection.java:411)
At Oracle.jdbc.driver.physicalconnection.<init> (physicalconnection.java:490)
At Oracle.jdbc.driver.t4cconnection.<init> (t4cconnection.java:202)
At Oracle.jdbc.driver.T4CDriverExtension.getConnection (t4cdriverextension.java:33)
At Oracle.jdbc.driver.OracleDriver.connect (oracledriver.java:474)
At Java.sql.DriverManager.getConnection (Unknown Source)
At Java.sql.DriverManager.getConnection (Unknown Source)
At CHAP6. Dbutil.getconnection (DBUTIL.JAVA:14)
At CHAP6. Statementdemo.main (statementdemo.java:15)
Java.sql.SQLException: Driver error or Connection failed!
At CHAP6. Dbutil.getconnection (DBUTIL.JAVA:20)
At CHAP6. Statementdemo.main (statementdemo.java:15)

Solution One

Then the firewall opened 3 ports, 8080, 8009, 8005, the problem is done


Solution II

Oracle's thin connection is divided into two types, one is the SID, the other is service name, and the difference is how the server configures the SID or service name, and after you configure the database, you can

The code is as follows Copy Code

D:oracleproduct10.2.0db_1networkadmin

Directory search, Tnsnames.ora file, look inside the parameters

According to the above data configuration to confirm which way

A, in the case of Sid mode, the JDBC Connection database is in the form of

The code is as follows Copy Code

String url = "Jdbc:oracle:thin:@//192.168.10.105:1522:uportal";

Note that in the case of a data instance, you use the English colon:

B, in the case of service mode, the JDBC connection data is in the form of

The code is as follows Copy Code

String url = "Jdbc:oracle:thin:@//192.168.10.105:1522/uportal";

Note that in the case of a data instance, you use the English slash/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.