[TIMOB-940] ResultSet should not point to the first row
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2011-04-15T02:39:43.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | iOS |
| Labels | resultset |
| Reporter | Hwerglmir |
| Assignee | Reggie Seagraves |
| Created | 2011-04-15T02:39:42.000+0000 |
| Updated | 2017-03-09T21:22:44.000+0000 |
Description
If I execute a SELECT it returns a ResultSet which is already pointing to the first row. So a while(rs.next()) loop is always skipping the first row. with a do while I'm eventually accessing an invalid row (if I don't check with isValidRow). Wouldn't it be better to point the ResultSet pointer to the "beforeFirst" row , like the ResultSet in java?
We modeled this after the Google Gears DB API (see http://code.google.com/apis/gears/api_database.html#ResultSet)">http://code.google.com/apis/gears/api_database.html#ResultSet).
The code should be something like:
This effectively is the same as JDBC as long as you're using isValidRow() as your loop condition.
Closing ticket as invalid.