This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes Exceptions in Batch Update process. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Exceptions in Batch Update process." Watch "Exceptions in Batch Update process." New topic
Author

Exceptions in Batch Update process.

Bhasker Reddy
Ranch Hand

Joined: Jun 13, 2000
Posts: 176
I am inserting millions of records using Batch update process. I mean preparedStatement and executeBatch method. for ex. when I insert 100000 records, sometimes some records fail to get inserted because the data doesn't match correctly to columns in the table. I want to capture this data into an exception table. But how do I know what was the sql error that caused it.
If I am not using executeBatch Method. It tells what sql exception it was. But How do I capture it in Batch process.
int[] updateCounts = preparedstatment.executeBatch();
updateCounts only has -2 or -3 based on success and failure of insert. How do I know what is the reason for the failure, what SQLException it has.


Bhasker Reddy
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Exceptions in Batch Update process.
 
Similar Threads
set commit size in spring
Batch Insertion
problems with batch update
batchupdate is not updating 1071 updates Urgent help required
jdbc driver behaviour