Handling Exceptions in batchUpdates

Hi Everybody,

I am using batchUpdates(i.e, using executeBatch()) to update our database. i am getting a single Exception message when my batch fails ( ofcourse, i will also get updateCounts from the BatchUpdateException , with which i can find out which statements are successful and which are not).our requirement is to track down the specific error messages of all the failed statements in the batch. Question is how do i determine the specific error message , if the batch fails to execute ?

your help is appreciated...

TIA

mgandham

[581 byte] By [mgandham] at [2007-9-26 4:32:32]
# 1

You would have to utilize an exceptions table. This is more DBA stuff, but this is how it works for Oracle:

1. create the exceptions table(utlexcpt.sql)

2.execute alter table with exceptions clause(refer to documentation)

now every insert/update you make that violates this constraint will make a row in the exceptions table which includes the rowid of the violation, owner, table_name, and the constraint violated.

Jamie

jlrober at 2007-6-29 17:47:14 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...