IBM Support

IC74895: DB2 JCC DRIVER MIGHT THROW EXCEPTION "JAVA.IO.CHARCONVERSIONEXCEPTION".

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • JCC driver throws the exception if fails to convert character.
    A typical scenario is some application using
    "ResultSet.getString" method to retrieve character strings from
    database and there are invalid characters in the string.
    
    By default, JCC driver uses "sun.io.*" methods to manipulate
    character strings. According to the standards for ""sun.io", it
    should throw the exception when fails to convert character
    strings (e.g. invalid characters that can not be converted).
    
    In the fix of the APAR, JCC driver introduces a global property
    named "db2.jcc.charsetDecoderEncoder" of type integer which
    could be set as follows:
    ===========================================
    1:
       This is the default.
       "sun.io.ByteToCharConverter" and/or
    "sun.io.CharToByteConverter" will be used if following classes
    could be loaded successfully:
       -- sun.io.ByteToCharConverter
       -- sun.io.CharToByteConverter
       -- sun.io.MalformedInputException
       -- sun.io.ConversionBufferFullException
       -- sun.io.UnknownCharacterException
       "java.nio.charset.CharsetDecoder" and/or
    "java.nio.charset.CharsetEncoder" will be used with
    "java.nio.charset.CodingErrorAction.REPORT" otherwise.
    
    2:
       "java.nio.charset.CharsetDecoder" and/or
    "java.nio.charset.CharsetEncoder" will be used with
    "java.nio.charset.CodingErrorAction.REPORT".
    
    3:
       "java.nio.charset.CharsetDecoder" and/or
    "java.nio.charset.CharsetEncoder" will be used with
    "java.nio.charset.CodingErrorAction.REPLACE".
    
    not defined or any other values:
       The default value will be used.
    ===========================================
    
    To avoid the exception, you need to specify value 3 for the
    global property "db2.jcc.charsetDecoderEncoder". By this way,
    JCC converts invalid characters to NULL instead of throwing
    exceptions, using "java.nio.charset.CodingErrorAction.REPLACE"
    in case of error.
    
    You can add following line into your Java property file if you
    already have one:
        db2.jcc.charsetDecoderEncoder=3
    or
        specify "-Ddb2.jcc.charsetDecoderEncoder=3" on Java command
    line.
    

Local fix

  • Remove invalid characters from the string stored in database.
    

Problem summary

  • Fixed in DB2 V9.7 FP5 JDBC drivers.
    

Problem conclusion

  • Upgrade the JDBC drivers to DB2 V9.7 FP5 drivers or above.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC74895

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-03-07

  • Closed date

    2015-04-08

  • Last modified date

    2015-04-08

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    IC74896

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC74895

Modified date: 08 April 2015