This week's book giveaway is in the OCAJP forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes using enhanced for insted of while - for reading resulset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "using enhanced for insted of while - for reading resulset" Watch "using enhanced for insted of while - for reading resulset" New topic
Author

using enhanced for insted of while - for reading resulset

Rohit Mehta
Ranch Hand

Joined: Mar 11, 2005
Posts: 79

hi
how can i read resultset using enhanced for loop - instead of while (rs.next)
thanks

rohit


- Rohit
Balagopal Kannampallil
Ranch Hand

Joined: Oct 18, 2004
Posts: 136

You cannot use ResultSet as such in an enhanced for-loop as it expects an Iterable object or an array. This link will help you understand the enhanced for-loop better.


SCJP 5.0 and now fighting with ExtJS
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using enhanced for insted of while - for reading resulset