懿之星落45℃ 2011-10-18 09:47 采纳率: 0%
浏览 380
已采纳

ORACLE总是报这样的错误啊,我首部了,

Cause: java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection

错误代码很长:写道

Caused by: java.sql.SQLException: Io 异常: 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.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.<init>(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 java.sql.DriverManager.getConnection(Unknown Source)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:174)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:165)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)
at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:210)
at $Proxy134.prepareStatement(Unknown Source)
at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.ibatis.common.jdbc.logging.ConnectionLogProxy.invoke(ConnectionLogProxy.java:53)
at $Proxy135.prepareStatement(Unknown Source)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.prepareStatement(SqlExecutor.java:497)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:175)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221)
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:189)
... 100 more

2011/10/17 11:27:31 DEBUG 000000000000885: null com.ustcsoft.sw.util.interceptor.AppExceptionInterceptor http-8080-2 -
--- The error occurred in sql/settlement_sql.xml.
--- The error occurred while executing query.
--- Check the select t$bapr as price, t$ptyp as type, trim(t$item) as componentNo, t$efdt as startDate, t$exdt2 as endDate, t$poty as orderType, t$endt as inputDate, ? as supplierNo, ? as queryStartDate, ? as queryEndDate from baan.v_erp2sws_partsprice where trim(t$bfbp) = ? and (t$ptyp = '3' or t$ptyp = '4') order by t$ptyp desc, t$endt desc .
--- Check the SQL Statement (preparation failed).
--- Cause: java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection
package: settlement settlementAction: searchUsableReceiveRow

 
问题补充
网上的方法不能很好的解决啊,到底是代码写的问题,还是数据库安装或配置问题?
问题补充
oracle我不太熟悉啊,什么监听是什么意思啊,为什么要监听
问题补充

AnnBaby 写道
我也遇到过了。

更新了jdbc jar 包就好了。

更新哪个包?我是10.2版本的oracle,用哪个包?
问题补充
oracle不是本地的,是在另一台机器上的,有什么问题?
问题补充
为什么会提示telnet不是内部命令,我疯了
问题补充
端口防火墙都没有问题,
具体的情况是
有时候会出现这个错误,比如修改某记录时
但有时候修改和插入数据又不会有这样的错误,太无语了
问题补充
好长好长的错误的代码,
如果是没连上数据库,为什么有的时候操作可以,有的时候就报这个错误
太无语了
  • 写回答

25条回答 默认 最新

  • mgj1982 2011-10-25 10:43
    关注

    建议你在本地装一个oracle实例,修改你的连接配置到本地,如无问题则问题出在网络上!
    建议你检查一下网络,这个异常表示你在获取数据库连接时失败了,你可以试着在本机 ping 一下你的数据库计算机 ping <数据库ip> -t 例如 ping 10.1.7.1 -t 看看网络是否稳定,是否有丢包的情况,如确定网络稳定,在更新oracle驱动程序,使用oracle自带的那个jdbc驱动包就可以了, 例如 D:\oracle10g\jdbc\lib下的classes12.jar 。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(24条)

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料