JDBC连接linux下的Oracle出错
Exception in thread "main "
java.sql.SQLException: Io 异常: The Network Adapter c
ould not establish the connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:111)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:145)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:254)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)
at oracle.jdbc.driver.PhysicalConnection. <init> (PhysicalConnection.java:
413)
at oracle.jdbc.driver.T4CConnection. <init> (T4CConnection.java:164)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtensio
n.java:34)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at Test.main(Test.java:12)
------解决方案--------------------非程序问题,
1、是否连接网线
2、看看IP,用户名是否正确
------解决方案--------------------网络连接有问题~~
------解决方案--------------------看看有没有开端口之类的.呵呵,这种错误一般不是程序问题.
------解决方案--------------------ping 一下数据库服务器,看看IP是不是通的.
如果是通的在用一个sqlplus取连接一下数据库,看看是不是可以登陆进去!