Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6931

ClientPreparedStatement doesn't support executeLargeBatch

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 10.11.1.1, 10.12.1.1, 10.13.1.1
    • None
    • JDBC, Network Client
    • None
    • Normal

    Description

      When trying to run executeLargeBatch on a PreparedStatement, the following error is seen:
      Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.lang.String
      at org.apache.derby.client.am.ClientStatement.flowExecuteBatch(ClientStatement.java:2460)
      at org.apache.derby.client.am.ClientStatement.executeBatchX(ClientStatement.java:1292)
      at org.apache.derby.client.am.ClientStatement.executeLargeBatch(ClientStatement.java:1269)
      at com.test.Main.main(Main.java:22)

      Upon further inspection, I found executeLargeBatch isn't implemented in ClientPreparedStatement and it is using ClientStatement instead. It pulls in the parameter for the PreparedStatement as a Statement, which is where the ClassCastException occurs. I will attach a simple reproduction.

      Attachments

        1. Main.java
          0.9 kB
          Mark Swatosh

        Activity

          People

            mswatosh Mark Swatosh
            mswatosh Mark Swatosh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: