mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-05 09:14:24 +01:00
Fix isBeforeFirst to return false for empty ResultSet
This commit is contained in:
@@ -104,6 +104,11 @@ public final class TursoResultSet {
|
||||
return pastLastRow;
|
||||
}
|
||||
|
||||
/** Checks whether the result set is empty (has no rows). */
|
||||
public boolean isEmpty() {
|
||||
return isEmptyResultSet;
|
||||
}
|
||||
|
||||
/** Gets the current row number (0-based, 0 means before first row). */
|
||||
public int getRow() {
|
||||
return row;
|
||||
|
||||
@@ -413,6 +413,10 @@ public final class JDBC4ResultSet implements ResultSet, ResultSetMetaData {
|
||||
|
||||
@Override
|
||||
public boolean isBeforeFirst() throws SQLException {
|
||||
// Empty ResultSet should return false per JDBC spec
|
||||
if (resultSet.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
return resultSet.isOpen() && resultSet.getRow() == 0 && !resultSet.isPastLastRow();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user