Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Question

 
Sumukh Deshpande
Ranch Hand
Posts: 87
Firefox Browser IntelliJ IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a scenario described as follows:

I have 2 UPDATE statements and 2 INSERT statements.
Lets name UPDATE statements as U1 and U2.
Lets name INSERT statements as I1 and I2.

Now what I want to do is:
If U1 fails I1 should not execute but I2 should execute.
If U2 fails both I1 and I2 can execute.

How to achieve this?
 
Campbell Ritchie
Sheriff
Posts: 48394
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are more likely to get a helpful answer if your thread title tells us what the question is about.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try catch blocks? Try to map it out here and we can help where you get stuck.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic