Doing 3 queries in three methods.

Hi

I have 3 queries
   1. is to get values of some items
   2. See if one of the  value in the table is set to "true"
   3. Update the flag to "false"

Query 1 can not go through until query 2 is successful and the value in table is set to "true"

Now using Resultset and Connection how do I do this in three methods or even in the same method. I dont want to duplicate the
Connection conn==........    code.

Thank you in advance for all the help
atwork2003Asked:
Who is Participating?
 
Mayank SAssociate Director - Product EngineeringCommented:
Look at the JDBC tutorial for a start:

http://java.sun.com/docs/books/tutorial/jdbc/
0
 
Manikandan ThiagarajanSenior consultantCommented:
use sub query
0
 
Mayank SAssociate Director - Product EngineeringCommented:
0
 
CEHJCommented:
Why can't you do

update x set y = true where y = false

?
0
 
atwork2003Author Commented:
Thank you guys for all the help:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.