Two Laptop Bag
The moose likes JDBC and Relational Databases and the fly likes JDBC Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC Question" Watch "JDBC Question" New topic

JDBC Question

Sumukh Deshpande
Ranch Hand

Joined: Feb 17, 2008
Posts: 87

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

Joined: Oct 13, 2005
Posts: 45276
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

Joined: May 26, 2003
Posts: 32811

Try catch blocks? Try to map it out here and we can help where you get stuck.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: JDBC Question
It's not a secret anymore!