I am using HsqlDB 1.8.1, and found something strange:
ResultSet rs;
...
boolean isLast=rs.isLast();
assert !isLast;
boolean hasNext=rs.next();
assert hasNext;
In my case, isLast is false, but hasNext is also false! Can you tell me why? I think if the cursor is not on the last row of this resultset, then it should have next row.
I take it you meant that your
hasNextassertion is failing becausehasNextis false, correct?Is your
ResultSetof typeTYPE_FORWARD_ONLY? Per the documentation forResultSet#isLast(), support for this method is “optional” in that case, though it’s not clear whether it being optional means that the method will throwSQLFeatureNotSupportedException, or just return false unconditionally.