Has anyone seen this NPE in Oracle JDBC driver?

梦想的初衷 提交于 2019-12-24 14:37:05

问题


We are going to be tracing the driver soon probably, but I wonder if someone has seen this. Some (3rd-party-library) code performs rs.next() on a resultset obtained from Oracle JDBC driver, and then calls rs.getLong() to get a long from a NUMBER column. All of this was working just fine for variety of versions of Oracle, JDBC, OSes, etc. for years, but on a particular machine, with Oracle 12.1.0.2 and ojdbc7 jar for that exact version (12.1.0.2, from http://www.oracle.com/technetwork/database/features/jdbc/default-2280470.html), the following exception happens:

java.lang.NullPointerException
    at java.lang.System.arraycopy(Native Method)
    at oracle.jdbc.driver.DynamicByteArray.get(DynamicByteArray.java:350)
    at oracle.jdbc.driver.NumberCommonAccessor.getLong(NumberCommonAccessor.java:546)
    at oracle.jdbc.driver.GeneratedStatement.getLong(GeneratedStatement.java:228)
    at oracle.jdbc.driver.GeneratedScrollableResultSet.getLong(GeneratedScrollableResultSet.java:564)

Unfortunately ojdbc is not open source. Is this a known issue? Is there some alternative jdbc driver to try?


回答1:


Which version of the Oracle JDBC thin driver are you using? There was a bug that produced an exception similar to yours in version 12.1.0.1. It was fixed in 12.1.0.2. So it looks like an upgrade of your driver might resolve your problem.



来源:https://stackoverflow.com/questions/33381256/has-anyone-seen-this-npe-in-oracle-jdbc-driver

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!