Oracle JDBC Driver BUG-4390875


プロジェクトプログラムは、Oracle JDBC Driver BUG-4390875に遭遇しました。毎回、文字化けを手動で更新し、かつ、プロジェクトの正常な動作に極めて影響を与えます。Oracleオフィシャルに連絡して、Metalinkからパッチp 4390875_をもらいます。1024_Generaic.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.05 Patch Setをダウンロードできます。このパッケージはOracle Enterpris ManagerをアップグレードしたGrid Controlのです。中のjdbcドライバを参照してもいいです。Oracle公式の説明でこのカバンの中もそのバグを修復しました。

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.