IBM Support

IT28261: JAVA.LANG.CLASSCASTEXCEPTION DURING EXECUTEBATCH() WITH SQLJAVOIDTIMESTAMPCONVERSION

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Description : While doing a batch insert of a timestamp with a
    batch size greater than 1 and the property
    SqljAvoidTimeStampConversion is set to true, ClassCastException
    is thrown. This behavior is seen in jcc drivers  Jcc driver 4.23
    and 4.24.
    DataSource.setSqljAvoidTimeStampConversion(true);
    connection = dataSource.getConnection();
    statement = connection.prepareStatement( "INSERT INTO APP.TEST (
    ID ) VALUES ( ? )" );
    String ts = "2018-12-12-16.24.04.123456";
    statement.setString(1, ts);
    statement.addBatch();
    statement.setString(1, ts);
    statement.addBatch();
    int[] b = statement.executeBatch();
    
    The exception is:
    Exception in thread "main" java.lang.ClassCastException:
    com.ibm.db2.jcc.am.InternalTimestamp incompatible with
    java.lang.String
    at com.ibm.db2.jcc.t4.ah.a(ah.java:1526)
    at com.ibm.db2.jcc.t4.ah.a(ah.java:1425)
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * 2                                                            *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to Vnext Jcc driver                                  *
    ****************************************************************
    

Problem conclusion

  • During batch operations, describe happens by default and it was
    causing the string to get converted to timestamp type. This
    behavior was avoided only for a particular date range
    before(10-10-1582 ? 20-10-1582). Now it has been made
    generalized and all date ranges are working fine. Fixed in Vnext
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT28261

  • Reported component name

    DB2 CONNECT

  • Reported component ID

    DB2CONNCT

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2019-03-01

  • Closed date

    2019-05-30

  • Last modified date

    2019-05-30

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

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

Fix information

  • Fixed component name

    DB2 CONNECT

  • Fixed component ID

    DB2CONNCT

Applicable component levels

  • RB10 PSY

       UP

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG19M"},"Platform":[{"code":"PF054","label":"z Systems"}],"Version":"11.1","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
19 June 2020