Register / Login
Win a copy of
97 Things Every Java Programmer Should Know
this week in the
Java in General
this forum made possible by our volunteer staff, including ...
Stephan van Hulst
JDBC and Relational Databases
PreparedStatement in batched mode gives Exception
posted 11 years ago
I have a problem.
I am running PreparedStatement 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 PreparedStatement batch loads.
Life called,so here I am.<br />Cheers<br />Niki.:-)
You can't expect to wield supreme executive power just because
Devious Experiments for a Truly Passive Greenhouse!
Boost this thread!
How can I do batch updates using PreparedStatements rather than Statements?
Performance of update statement versus comparison function
Can you insert into the database without using insert query in a Resultset
Batch update problem in Spring Prepared statement
read large CSV file and update the database