Interface RowData

All Known Implementing Classes:
RowDataCursor, RowDataDynamic, RowDataStatic

public interface RowData
This interface abstracts away how row data is accessed by the result set. It is meant to allow a static implementation (Current version), and a streaming one.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    What's returned for the size of a result set when its size can not be determined.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a row to this row data.
    void
    Moves to after last.
    void
    Moves to before first.
    void
    Moves to before last so next el is the last el.
    void
    We're done.
    getAt(int index)
    Only works on non dynamic result sets.
    int
    Returns the current position in the result set as a row number.
    Returns the result set that 'owns' this RowData
    boolean
    Returns true if another row exsists.
    boolean
    Returns true if we got the last element.
    boolean
    Returns if iteration has not occured yet.
    boolean
    Returns true if the result set is dynamic.
    boolean
    Has no records.
    boolean
    Are we on the first row of the result set?
    boolean
    Are we on the last row of the result set?
    void
    moveRowRelative(int rows)
    Moves the current position relative 'rows' from the current position.
    Returns the next row.
    void
    removeRow(int index)
    Removes the row at the given index.
    void
    setCurrentRow(int rowNumber)
    Moves the current position in the result set to the given row number.
    void
    setMetadata(Field[] metadata)
    Sometimes the driver doesn't have metadata until after the statement has the result set in-hand (because it's cached), so it can call this to set it after the fact.
    void
    Set the result set that 'owns' this RowData
    int
    Only works on non dynamic result sets.
    boolean
    Did this result set have no rows?
  • Field Details

    • RESULT_SET_SIZE_UNKNOWN

      static final int RESULT_SET_SIZE_UNKNOWN
      What's returned for the size of a result set when its size can not be determined.
      See Also:
  • Method Details

    • addRow

      void addRow(ResultSetRow row) throws SQLException
      Adds a row to this row data.
      Parameters:
      row - the row to add
      Throws:
      SQLException - if a database error occurs
    • afterLast

      void afterLast() throws SQLException
      Moves to after last.
      Throws:
      SQLException - if a database error occurs
    • beforeFirst

      void beforeFirst() throws SQLException
      Moves to before first.
      Throws:
      SQLException - if a database error occurs
    • beforeLast

      void beforeLast() throws SQLException
      Moves to before last so next el is the last el.
      Throws:
      SQLException - if a database error occurs
    • close

      void close() throws SQLException
      We're done.
      Throws:
      SQLException - if a database error occurs
    • getAt

      ResultSetRow getAt(int index) throws SQLException
      Only works on non dynamic result sets.
      Parameters:
      index - row number to get at
      Returns:
      row data at index
      Throws:
      SQLException - if a database error occurs
    • getCurrentRowNumber

      int getCurrentRowNumber() throws SQLException
      Returns the current position in the result set as a row number.
      Returns:
      the current row number
      Throws:
      SQLException - if a database error occurs
    • getOwner

      Returns the result set that 'owns' this RowData
    • hasNext

      boolean hasNext() throws SQLException
      Returns true if another row exsists.
      Returns:
      true if more rows
      Throws:
      SQLException - if a database error occurs
    • isAfterLast

      boolean isAfterLast() throws SQLException
      Returns true if we got the last element.
      Returns:
      true if after last row
      Throws:
      SQLException - if a database error occurs
    • isBeforeFirst

      boolean isBeforeFirst() throws SQLException
      Returns if iteration has not occured yet.
      Returns:
      true if before first row
      Throws:
      SQLException - if a database error occurs
    • isDynamic

      boolean isDynamic() throws SQLException
      Returns true if the result set is dynamic. This means that move back and move forward won't work because we do not hold on to the records.
      Returns:
      true if this result set is streaming from the server
      Throws:
      SQLException - if a database error occurs
    • isEmpty

      boolean isEmpty() throws SQLException
      Has no records.
      Returns:
      true if no records
      Throws:
      SQLException - if a database error occurs
    • isFirst

      boolean isFirst() throws SQLException
      Are we on the first row of the result set?
      Returns:
      true if on first row
      Throws:
      SQLException - if a database error occurs
    • isLast

      boolean isLast() throws SQLException
      Are we on the last row of the result set?
      Returns:
      true if on last row
      Throws:
      SQLException - if a database error occurs
    • moveRowRelative

      void moveRowRelative(int rows) throws SQLException
      Moves the current position relative 'rows' from the current position.
      Parameters:
      rows - the relative number of rows to move
      Throws:
      SQLException - if a database error occurs
    • next

      ResultSetRow next() throws SQLException
      Returns the next row.
      Returns:
      the next row value
      Throws:
      SQLException - if a database error occurs
    • removeRow

      void removeRow(int index) throws SQLException
      Removes the row at the given index.
      Parameters:
      index - the row to move to
      Throws:
      SQLException - if a database error occurs
    • setCurrentRow

      void setCurrentRow(int rowNumber) throws SQLException
      Moves the current position in the result set to the given row number.
      Parameters:
      rowNumber - row to move to
      Throws:
      SQLException - if a database error occurs
    • setOwner

      void setOwner(ResultSetImpl rs)
      Set the result set that 'owns' this RowData
      Parameters:
      rs - the result set that 'owns' this RowData
    • size

      int size() throws SQLException
      Only works on non dynamic result sets.
      Returns:
      the size of this row data
      Throws:
      SQLException - if a database error occurs
    • wasEmpty

      boolean wasEmpty()
      Did this result set have no rows?
    • setMetadata

      void setMetadata(Field[] metadata)
      Sometimes the driver doesn't have metadata until after the statement has the result set in-hand (because it's cached), so it can call this to set it after the fact.
      Parameters:
      metadata - field-level metadata for the result set