Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how can I get the error records that did not get executed successfully using executeBatch()

user10013792Jul 9 2014 — edited Oct 15 2014

Hi,

My situation is that with Oracle version 11.1 (11g) I am not getting the rows of the records that did not either get updated or inserted.

- Database Version: Oracle Database 11g Release 11.1.0.0.0 - Production Driver: Oracle JDBC driver

insertcount: 10  -- Here I am inserting the 10 ROWS and then I call to execute the Batch Update on these ROWS, creating a failure for 3 rows. However I do not get any information on the records that did not get updated successfully.

atr updates: [0:-2][1:-2][2:-2][3:-2][4:-2][5:-2][6:-2][7:-2][8:-2][9:-2] number of records updated Count: 7 number of record sent to be updated: 10 local commit count: 10

Final Total Records Updated: 7

As you see above I am printed the array that is returned after calling the executeBatch, however it does not return the correct value of record not having been updated.

How can I implement a solution that will allow me to know which records were update and which records were not updated... I know the work around to manually call one statement at a time however that is not a good solution.... also as per the API it should return the right values.

Any help on this would be highly appreciated.

Regards & thanks in advance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 6 2014
Added on Jul 9 2014
12 comments
2,370 views