Package app.babylon.table.plans
Class TablePlanReadJdbc
java.lang.Object
app.babylon.table.plans.TablePlanCommon<TablePlanReadJdbc>
app.babylon.table.plans.TablePlanReadJdbc
- All Implemented Interfaces:
TablePlan
JDBC-specific read plan that materialises a
ResultSet directly into a
TableColumnar.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExecutes this plan against an already-open row supplier.Executes this plan against a configured row source.getColumnType(ColumnName columnName) protected TablePlanReadJdbcself()withColumnType(ColumnName columnName, Column.Type columnType) withColumnTypes(Map<ColumnName, Column.Type> columnTypes) withSelectedColumn(ColumnName columnName) withSelectedColumns(ColumnName... columnNames) withSelectedColumns(Iterable<ColumnName> columnNames) withSelectedColumns(Collection<ColumnName> columnNames) Methods inherited from class app.babylon.table.plans.TablePlanCommon
getTableDescription, getTableName, withTableDescription, withTableName
-
Constructor Details
-
TablePlanReadJdbc
public TablePlanReadJdbc()
-
-
Method Details
-
withSelectedColumn
-
withSelectedColumns
-
withSelectedColumns
-
withSelectedColumns
-
getSelectedColumns
-
withColumnType
-
withColumnTypes
-
getColumnType
-
getColumnTypes
-
execute
-
execute
Description copied from interface:TablePlanExecutes this plan against an already-open row supplier.Use this lower-level entry point when the caller already owns the live source resource and wants to control its lifetime explicitly.
CSV example:
JDBC example:StreamSource streamSource = ...; TablePlanRead plan = new TablePlanRead(); try (InputStream inputStream = streamSource.openStream(); RowCursor rowCursor = RowCursorCsv.builder() .withSeparator(';') .build(inputStream)) { TableColumnar table = plan.execute(rowCursor); }PreparedStatement preparedStatement = ...; TablePlanRead plan = new TablePlanRead(); try (ResultSet resultSet = preparedStatement.executeQuery(); RowCursor rowCursor = new RowCursorResultSet(resultSet)) { TableColumnar table = plan.execute(rowCursor); }- Parameters:
rowCursor- open row supplier to consume- Returns:
- the resulting table
-
execute
Description copied from interface:TablePlanExecutes this plan against a configured row source.This is the simplest high-level entry point when the source should handle opening and closing its own row supplier internally.
CSV example:
JDBC example:StreamSource streamSource = ...; TablePlanRead plan = new TablePlanRead(); TableColumnar table = plan.execute(RowSourceCsv.builder() .withStreamSource(streamSource) .withSeparator(';') .build());PreparedStatement preparedStatement = ...; TablePlanRead plan = new TablePlanRead(); TableColumnar table = plan.execute(RowSourceResultSet.builder() .withPreparedStatement(preparedStatement) .build());- Parameters:
rowSource- configured source that opens rows for this execution- Returns:
- the resulting table
-
self
- Specified by:
selfin classTablePlanCommon<TablePlanReadJdbc>
-