Sunday, March 16, 2003 12:36 PM
The ResultSet uses a pointer variable which points to the current row. This pointer is set before the first row after your query. Thats why you have to call rs.next() at least one time before retrieving any data from the result set.
If no row was returned by your query, the first call to rs.next() will return false, it won't throw an exception.
The following code fragment shows you, how to iterate through a result set:
ResultSet rs = statement.excuteQuery();
// copy data from rs
If you are interested in the first row, you can use if() instead of while().