This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes how can I have multiple return from this method? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how can I have multiple return from this method?" Watch "how can I have multiple return from this method?" New topic
Author

how can I have multiple return from this method?

sahar sa
Ranch Hand

Joined: Jul 06, 2009
Posts: 102
hi,
I want the select method to select some data from DB and then return it . but i dont know how can I return multiple or a row of data ?
can you give me an idea how can i do it?

here is the code which i used for my select query:


thnx,
Sahar.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You will need to go through your ResultSet and assign its values to a Collection of objects.

(And you've probably already noticed, but that is a delete statement, not a select query)


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
wood burning stoves
 
subject: how can I have multiple return from this method?
 
Similar Threads
select .... where... query for a variable?
reasons for error: SQLException: No operations allowed after connection closed?
closing connection?
can not insert to DB after a while!
problem in returning data using resultset