• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error during large batch insertion for preparedstatement (395 parameters)

Sean Chang
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am using db2 and jdbc preparedstatements in java to insert a large number of columns (395 parameters in this example), and I have about 20 other tables with similar column sizes, and are inserting in a batch. I am getting an error when trying to do this, is there a limitation to the number of parameters I can use?

Here is some sample code
values[395] (this is loaded earlier in the program to 395 items), and the preparedstatement is also 395


I am getting the following error from this
2009-08-26 20:43:32,326 main] ERROR (DicomManager.java:483) - Contents of BatchUpdateException:
[2009-08-26 20:43:32,326 main] ERROR (DicomManager.java:484) - Update counts:
[2009-08-26 20:43:32,326 main] ERROR (DicomManager.java:487) - Statement 0:-3
[2009-08-26 20:43:32,326 main] ERROR (DicomManager.java:489) - Message: Non-atomic batch failure. The batch was submitted, but at least one exception occurred on an individual member of the batch. Use getNextException() to retrieve the exceptions for specific batched elements.
[2009-08-26 20:43:32,326 main] ERROR (DicomManager.java:490) - SQLSTATE: null
[2009-08-26 20:43:32,326 main] ERROR (DicomManager.java:491) - Error code: -99999
[2009-08-26 20:43:32,326 main] ERROR (DicomManager.java:494) - SQL exception:
[2009-08-26 20:43:32,326 main] ERROR (DicomManager.java:495) - Message: Error for batch element #0: DB2 SQL error: SQLCODE: -302, SQLSTATE: 22001, SQLERRMC: null
[2009-08-26 20:43:32,326 main] ERROR (DicomManager.java:496) - SQLSTATE: 22001
[2009-08-26 20:43:32,326 main] ERROR (DicomManager.java:497) - Error code: -302

Anyone know if this is a limitation of preparedstatments, and if so, what is a possible other solution to this
Deepak Bala
Posts: 6663
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears one of your sql queries has a problem which is causing the batch not to commit correctly
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!