Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

With respect to Batch execution in JDBC

 
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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.

 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do not execute them in batch then, but one by one.
 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is just intented to execute a batch in the DB? Or don't you understand what a batch concerns?
 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 212
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks , i got the solution .
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic