• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Error during large batch insertion for preparedstatement (395 parameters)

Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 6663
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It appears one of your sql queries has a problem which is causing the batch not to commit correctly
    Bookmark Topic Watch Topic
  • New Topic