mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-09 19:24:21 +01:00
feat(java): implement isBeforeFirst(), isAfterLast() in JDBC4ResultSet
This commit is contained in:
@@ -99,6 +99,16 @@ public final class TursoResultSet {
|
||||
return lastStepResult != null && lastStepResult.isRow();
|
||||
}
|
||||
|
||||
/** Checks whether the cursor is positioned after the last row. */
|
||||
public boolean isPastLastRow() {
|
||||
return pastLastRow;
|
||||
}
|
||||
|
||||
/** Gets the current row number (0-based, 0 means before first row). */
|
||||
public int getRow() {
|
||||
return row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the status of the result set.
|
||||
*
|
||||
|
||||
@@ -413,12 +413,12 @@ public final class JDBC4ResultSet implements ResultSet, ResultSetMetaData {
|
||||
|
||||
@Override
|
||||
public boolean isBeforeFirst() throws SQLException {
|
||||
throw new UnsupportedOperationException("not implemented");
|
||||
return resultSet.isOpen() && resultSet.getRow() == 0 && !resultSet.isPastLastRow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAfterLast() throws SQLException {
|
||||
throw new UnsupportedOperationException("not implemented");
|
||||
return resultSet.isOpen() && resultSet.isPastLastRow();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user