?
Solved

Doing 3 queries in three methods.

Posted on 2006-04-25
5
Medium Priority
?
158 Views
Last Modified: 2010-03-31
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
0
Comment
Question by:atwork2003
5 Comments
 
LVL 9

Expert Comment

by:Manikandan Thiagarajan
ID: 16540609
use sub query
0
 
LVL 30

Accepted Solution

by:
Mayank S earned 2000 total points
ID: 16541175
Look at the JDBC tutorial for a start:

http://java.sun.com/docs/books/tutorial/jdbc/
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 16541179
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16542061
Why can't you do

update x set y = true where y = false

?
0
 

Author Comment

by:atwork2003
ID: 16591302
Thank you guys for all the help:)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month15 days, 12 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question