This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JDBC and the fly likes With respect to Batch execution in JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "With respect to Batch execution in JDBC" Watch "With respect to Batch execution in JDBC" New topic
Author

With respect to Batch execution in JDBC

PavanPL KalyanK
Ranch Hand

Joined: Feb 28, 2009
Posts: 212


Hello ,

I am doing insertion operation so keeping all the statements in Batch . On this some statements execute and some are failing .

If a single statement fails , a BatchUpdateException is caught and all other statements are rolled back .

what should i do to in order to accomplish let other statements execute even if some fail.



waiting for your suggestions.

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Do not execute them in batch then, but one by one.
PavanPL KalyanK
Ranch Hand

Joined: Feb 28, 2009
Posts: 212
Bauke Scholtz wrote:Do not execute them in batch then, but one by one.


Then what is the use of doing addBatch ?? How can i take the advantage of BatchStatements.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
It is just intented to execute a batch in the DB? Or don't you understand what a batch concerns?
PavanPL KalyanK
Ranch Hand

Joined: Feb 28, 2009
Posts: 212


I did not get what you mean to say.

Assume this my piece of code . Could you please suggest what are trying to suggest.
PavanPL KalyanK
Ranch Hand

Joined: Feb 28, 2009
Posts: 212
Thanks , i got the solution .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: With respect to Batch execution in JDBC