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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 77

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
 
Similar Threads
Enums and operators
Array reverse
List Duplicated
Problem with priority Queue
how we can create xls file in java