Package app.babylon.table.io
Class RowCursorResultSet
java.lang.Object
app.babylon.table.io.RowCursorResultSet
- All Implemented Interfaces:
RowCursor,AutoCloseable
Supplies rows from a caller-owned
ResultSet.
This supplier adapts a caller-owned ResultSet. Closing the supplier
is a no-op; the caller remains responsible for the lifecycle of the
underlying JDBC resources.
Example:
Connection connection = ...;
try (PreparedStatement statement = connection
.prepareStatement("select city, amount from trades where trade_date >= ?"))
{
statement.setDate(1, java.sql.Date.valueOf("2026-01-01"));
try (ResultSet resultSet = statement.executeQuery())
{
RowCursor supplier = new RowCursorResultSet(resultSet);
ColumnDefinition[] columns = supplier.columns();
while (supplier.next())
{
Row row = supplier.current();
}
}
}
This implementation is a demonstration of what is possible and the likely
structure given the ResultSet API. Different drivers may still have quirks
that require special implementations.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RowCursorResultSet
-
-
Method Details
-
columns
Description copied from interface:RowCursorReturns the source-side column definitions exposed by this cursor.A non-null
typehere is not just metadata. It can be used by downstream row consumers to choose a more direct builder from the start, bypassing intermediateStringmaterialization when the source type already has an efficient slice-based parser.That is most useful for primitive numerics and for special object types whose direct parser is genuinely better than first building a string dictionary.
-
next
public boolean next() -
current
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceRowCursor- Throws:
SQLException
-