Class TablePlanReadJdbc

All Implemented Interfaces:
TablePlan

public class TablePlanReadJdbc extends TablePlanCommon<TablePlanReadJdbc>
JDBC-specific read plan that materialises a ResultSet directly into a TableColumnar.
  • Constructor Details

    • TablePlanReadJdbc

      public TablePlanReadJdbc()
  • Method Details

    • withSelectedColumn

      public TablePlanReadJdbc withSelectedColumn(ColumnName columnName)
    • withSelectedColumns

      public TablePlanReadJdbc withSelectedColumns(ColumnName... columnNames)
    • withSelectedColumns

      public TablePlanReadJdbc withSelectedColumns(Collection<ColumnName> columnNames)
    • withSelectedColumns

      public TablePlanReadJdbc withSelectedColumns(Iterable<ColumnName> columnNames)
    • getSelectedColumns

      public Set<ColumnName> getSelectedColumns()
    • withColumnType

      public TablePlanReadJdbc withColumnType(ColumnName columnName, Column.Type columnType)
    • withColumnTypes

      public TablePlanReadJdbc withColumnTypes(Map<ColumnName,Column.Type> columnTypes)
    • getColumnType

      public Column.Type getColumnType(ColumnName columnName)
    • getColumnTypes

      public Map<ColumnName,Column.Type> getColumnTypes()
    • execute

      public TableColumnar execute(ResultSet resultSet)
    • execute

      public TableColumnar execute(RowCursor rowCursor)
      Description copied from interface: TablePlan
      Executes 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.

      For CSV, open the input stream, create a RowCursor, then pass that cursor to this method inside the caller's resource scope. For JDBC, execute the prepared statement, wrap the live ResultSet in a row cursor, and pass it to this method before closing the JDBC resources.

      Parameters:
      rowCursor - open row supplier to consume
      Returns:
      the resulting table
    • execute

      public TableColumnar execute(RowSource rowSource)
      Description copied from interface: TablePlan
      Executes 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.

      For CSV or JDBC, build an appropriate RowSource and pass it to this method. The row source owns the open/close lifecycle for each execution.

      Parameters:
      rowSource - configured source that opens rows for this execution
      Returns:
      the resulting table
    • self

      protected TablePlanReadJdbc self()
      Specified by:
      self in class TablePlanCommon<TablePlanReadJdbc>