Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the reasons for the exception of JDBC connection Oracle

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail what are the reasons for JDBC connection exceptions in Oracle. Xiaobian thinks it is quite practical, so share it with you as a reference. I hope you can gain something after reading this article.

When you connect to Oracle database through JDBC, an exception occurs. First of all, you should confirm whether your JRE is configured correctly. Generally, oracle 10g, JRE1.4 and above should use ojdbc14.jar.

Second, you need to determine whether your Java syntax is wrong. The syntax here refers to the format of the protocol on the URL connecting to the database. For example: jdbc:oracle:thin: @127.0.1:1521:pg, light red indicates that the thin mode (thin client) is used to connect, black indicates the IP of the database, cyan indicates the port used by the listener, default 1521, *** Dark red indicates the global ID of the database, and the complete writing should be SID.Domain.

When you are sure that your program and JRE are configured correctly and there are still exceptions, you need to check your Oracle network configuration. Generally, a listener can listen to multiple database instances. If your database instance was created automatically by the installer during installation, your Oracle network configuration will configure it for you. If your instance is created by yourself, then in addition to configuring the listening location with net manager, you also need to configure the database instance to be listened to for the listener. If the listener has nothing configured, you will not be able to connect to the database instance. If you only configure the listening location, you can also connect through oracle's own client on the local machine. You cannot connect through the program. So, as a developer, I think you should configure the listener completely.

I JDBC Connection Oracle Exception Information:

java.sql.SQLException: Io anomaly: The Network Adapter could not establish the connection at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387) at oracle.jdbc.driver.PhysicalConnection. (PhysicalConnection.java:414) at oracle.jdbc.driver.T4CConnection. (T4CConnection.java:165) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801) at java.sql. DriverManager. getConnection (Unknown Source) at tool.DbConnect.getConnect(DbConnect.java:45) at tool.DbConnect.main(DbConnect.java:54) About "JDBC connection Oracle exception causes what" This article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report