Oracle JDBC Driver BUG-4390875

项目程序遭遇Oracle JDBC Driver BUG-4390875 , 每次都得手动更新乱码字符,而且极度影响到项目的正常运行.联系Oracle官方,从Metalink得到补丁包p4390875_10204_Generic.zip.然后按照官方说明操作.最后更新到服务器的lib目录,替换旧的. 一切运行正常了.

//BUG-4390875说明:
THIN driver throw NullPointerExceoption for
OracleResultSet.getString() of invalid characters in AL32UTF8
database.

//显示异常

Caused by: java.lang.NullPointerException
        at java.lang.String.<init>(String.java:176)
        at oracle.sql.CharacterSet.AL32UTF8ToString(CharacterSet.java:1517)
        at oracle.jdbc.driver.DBConversion.CharBytesToString(DBConversion.java:589)
        at oracle.jdbc.driver.DBConversion.CharBytesToString(DBConversion.java:542)
        at oracle.jdbc.driver.LongAccessor.getString(LongAccessor.java:217)
        at oracle.jdbc.driver.T4CLongAccessor.getString(T4CLongAccessor.java:422)
        at oracle.jdbc.driver.CharCommonAccessor.getObject(CharCommonAccessor.java:688)
        at oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java:915)
        at org.springframework.jdbc.support.JdbcUtils.getResultSetValue(JdbcUtils.java:226)




没有Metalink帐户的话,可以直接去Oracle网站下载Oracle发布的10.2.0.5 Patch Set(该包是升级Oracle Enterprise Manager的Grid Control的) 引用里面的jdbc 驱动也可以,因为Oracle官方说明这个包里也修复了那个bug.


Make sure that when using the 11g JDBC drivers you replace ojdbc14.jar with either ojdbc5.jar when using the jdk 1.5. And with ojdbc6.jar when using the jdk 1.6.

   1. Download the required one-off/backport patch from MetaLink.
   2. Extract this downloaded to patch to an arbitrary directory on the local system.
   3. Make a note of the extracted .class file(s) in the patch, as well as the exact path to those files.  Only the .class files are of interest; ignore any other files included in the extracted patch.
   4. Create another temporary directory (hereafter referred to as "TEMP") -- make sure that this directory is empty.
   5. Copy the old JDBC JAR file to the TEMP directory.
   6. Extract the JDBC JAR file using the following syntax:
      % jar xvf ojdbc14.jar
   7. Replace the specific .class files in the extracted JDBC JAR file with the corresponding fixed .class files in the patch.
   8. Remove the JDBC JAR file from the TEMP directory.
   9. Re-JAR the JDBC JAR file using the following syntax:
      % jar cvf ojdbc14.jar *
  10. Copy the newly made JDBC JAR file to its original location.





你可能感兴趣的:(java,jdk,oracle,sql,jdbc)