aspose file tools*
The moose likes JDBC 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
JavaRanch » Java Forums » Databases » JDBC
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