日期:2014-05-19  浏览次数:20730 次

java.sql.SQLException: Io 异常: The Network Adapter could not establish the conn e
java.sql.SQLException: Io 异常: The Network Adapter could not establish the conn
ection
  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:333)
  at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:404)

  at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:468)
  at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
  at java.sql.DriverManager.getConnection(DriverManager.java:579)
  at java.sql.DriverManager.getConnection(DriverManager.java:221)
  at com.dz.corrosion.integration.action.QueryService.doPost(QueryService.
java:67)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:304)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:208)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:240)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:203)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:164)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:108)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
558)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:118)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:379)
  at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcesso
r.java:281)
  at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.pr
ocess(Http11AprProtocol.java:357)
  at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoin
t.java:1671)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1110)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:603)
  at java.lang.Thread.run(Thread.java:722)

-------------------------------------
oracle数据库10G
为啥会报这样的错误呢?数据库所有的服务都已经打开了,同样的数据库,另一套系统就没有错误,但是在这个就报错,前面连接的数据库服务器由于搬迁,暂时不可用,所以将备份文件导入本地数据库。更改连接地址后报这样的错误!

------解决方案--------------------
Double Check 下URL字符串和防火墙配置之类的问题。

防火墙方面的话,可以在系统所在机器试试看:
telnet 目标主机IP 端口号
------解决方案--------------------
链接数据库的配置可能有问题 看看用户名密码 链接的库对不对
------解决方案--------------------
应该是网络的问题,确认配置连接的IP和端口是否正确,再用TELNET命令检查是否连通,用空格而不是冒号。
telnet 10.79.20.138 1521

------解决方案--------------------
探讨
C:\Documents and Settings\Administrator>telnet 10.79.20.138:1521
正在连接到10.79.20.138:1521...不能打开到主机的连接, 在端口 23: 连接失败

------解决方案--------------------