如何使用 oracle.jdbc.driver.OracleLog?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/182073/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I use oracle.jdbc.driver.OracleLog?
提问by Matthew Murdoch
I am receiving an error from the Oracle JDBC driver (ojdbc14_g.jar) when trying to obtain a connection to a 10g database. The driver has an oracle.jdbc.driver.OracleLog class which could help but the Oracle documentation is unclear how best to use it. Has anyone had any success using this class? If so, some guidance on its use would be appreciated.
尝试获取与 10g 数据库的连接时,我收到来自 Oracle JDBC 驱动程序 (ojdbc14_g.jar) 的错误消息。该驱动程序有一个 oracle.jdbc.driver.OracleLog 类,它可以提供帮助,但 Oracle 文档不清楚如何最好地使用它。有没有人成功使用过这个类?如果是这样,将不胜感激有关其使用的一些指导。
For info, the error I'm getting from the JDBC driver is:
有关信息,我从 JDBC 驱动程序得到的错误是:
java.sql.SQLException: No more data to read from socket
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:208)
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1
(T4CMAREngine.java:1118)
at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1
(T4CMAREngine.java:1070)
at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOsesskey
(T4CTTIoauthenticate.java:266)
at oracle.jdbc.driver.T4CConnection.logon
(T4CConnection.java:357)
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 oracle.jdbc.pool.OracleDataSource.getPhysicalConnection
(OracleDataSource.java:297)
at oracle.jdbc.pool.OracleDataSource.getConnection
(OracleDataSource.java:221)
at oracle.jdbc.pool.OracleDataSource.getConnection
(OracleDataSource.java:165)
采纳答案by Andrew not the Saint
The logging is usually too low to be interpreted by anyone except Oracle support.
日志记录通常太低,除 Oracle 支持外的任何人都无法解释。
Anyway, the above code indicates there is some network connectivity issue between the client and the server (more data was expected to be read from the TCP socket but it somehow got interrupted). What kind of a network are you using? You checked the status and error logs on the server listener?
无论如何,上面的代码表明客户端和服务器之间存在一些网络连接问题(期望从 TCP 套接字读取更多数据,但不知何故被中断)。你使用什么样的网络?您检查了服务器侦听器上的状态和错误日志吗?