SAP Knowledge Base Article - Preview

2159562 - jConnect: Insert into select SQL fails when ENABLE_BULK_LOAD=BCP and DYNAMIC_PREPARE=false, ArrayIndexOutOfBoundsException or ClassCastException - SAP SDK

Symptom

  • Running command like Insert into #temptest select [column list] from table where c1 >= ? AND (c2 = 'one' OR c2 = 'two) AND (c4 >= ? OR c4 >= ?) fails with the following:
     
    • java.lang.ArrayIndexOutOfBoundsException: while trying to store to index -1 of an object array with length 4, loaded from field com.sybase.jdbc4.jdbc.SybPreparedStatement._object of an object loaded from local variable 'this'
      at com.sybase.jdbc4.jdbc.SybPreparedStatement.setParamBulk(SybPreparedStatement.java)
      at com.sybase.jdbc4.jdbc.SybPreparedStatement.setParam(SybPreparedStatement.java)
      at com.sybase.jdbc4.jdbc.SybPreparedStatement.setParam(SybPreparedStatement.java)
      at com.sybase.jdbc4.jdbc.SybPreparedStatement.setTimestamp(SybPreparedStatement.java)
      at TestPrepareDatetime.main(TestPrepareDatetime.java)
       
  • If the literals are removed from the where clause and parameters are Timestamp (where c4 >= ? AND (c4 >= ? OR c4 >= ?)):
     
    • java.lang.ClassCastException: Cannot cast class com.sybase.jdbc4.tds.SybTimestamp to class com.sybase.jdbc4.jdbc.DateObject
      at com.sybase.jdbc4.tds.TdsParam.checkDateRange(TdsParam.java)
      at com.sybase.jdbc4.tds.TdsParam.prepareForSend(TdsParam.java)
      at com.sybase.jdbc4.jdbc.ParamManager.checkParams(ParamManager.java)
      at com.sybase.jdbc4.tds.Tds.language(Tds.java)
      at com.sybase.jdbc4.jdbc.SybStatement.sendQuery(SybStatement.java)
      at com.sybase.jdbc4.jdbc.SybPreparedStatement.sendQuery(SybPreparedStatement.java)
      at com.sybase.jdbc4.jdbc.SybStatement.executeUpdate(SybStatement.java)
      at com.sybase.jdbc4.jdbc.SybPreparedStatement.executeUpdate(SybPreparedStatement.java)
      at TestPrepareDatetime.main(TestPrepareDatetime.java)

Read more...

Environment

  • jConnect
    • JDBC 7.07
    • JDBC 16
  • SAP Adaptive Server Enterprise (ASE) 15.7 and 16.0
  • SAP Sybase Software Developers Kit (SDK) 15.7
  • SAP Software Developers Kit (SDK) for Adaptive Server Enterprise (ASE) 16.0
  • SAP Java Virtual Machine 1.7

Product

SAP Adaptive Server Enterprise 15.7 ; SAP Adaptive Server Enterprise 16.0 ; SAP Adaptive Server Enterprise SDK 16.0 ; Sybase SDK 15.7 ; Sybase Software Developer Kit 15.7

Keywords

jconn, OCS, SDK for SAP ASE, CR#783068, CR783068, 783068 , KBA , jconn , BC-SYB-SDK , SDK , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.