A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
PreparedStatement in batched mode gives Exception
Joined: Mar 20, 2005
Jun 04, 2009 01:15:51
I have a problem.
I am running
in batched mode, actually I am using Springs BatchSQLUpdate component.
Now i am creating a batch of about 10000 inserts / updates. However if any single of these inserts / updates fails, it gives exception with DataIntegrityViolation, BadSQLGrammer etc.
I am also maintaining a parallel cache of the values that I am using to bind the preparedstatements.
So for statement 1 in the batch, i know what values are being used.
My question is when the batch update fails, how can we identify which SQL statement, i mean which index in the batch caused the issue?
Please help me as I am stuck and need to build some robust exception handling for
Life called,so here I am.<br />Cheers<br />Niki.:-)
I agree. Here's the link:
subject: PreparedStatement in batched mode gives Exception
How can I do batch updates using PreparedStatements rather than Statements?
read large CSV file and update the database
Can you insert into the database without using insert query in a Resultset
Performance of update statement versus comparison function
Batch update problem in Spring Prepared statement
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014