for(int iIndex=0;iIndex<RowCount;iIndex++) { rs.next() } There are some methods in the API where you can get the row count. Alternatively you can do a count* using your where condition and you will get the row count although its a bad programming practise hence use the API. cheers [ March 26, 2004: Message edited by: Gaurav Jain ]
Madhavan, I'd be wary of using rowCount because the driver usually has to loop through all the rows to get it. You really should use the while loop though. It's pretty standard.
quote: -------------------------------------------------------------------------------- for (; rs.next(); ) { //everything you had in the while loop} ---------------------------------------------------------------------------- I once try this ,but when I use while (rs.next()) later, it is something wrong.