Class RowDataStatic

java.lang.Object
com.mysql.jdbc.RowDataStatic
All Implemented Interfaces:
RowData

public class RowDataStatic extends Object implements RowData
Represents an in-memory result set
  • Field Details

  • Constructor Details

    • RowDataStatic

      public RowDataStatic(List<ResultSetRow> rows)
      Creates a new RowDataStatic object.
      Parameters:
      rows -
  • Method Details

    • addRow

      public void addRow(ResultSetRow row)
      Description copied from interface: RowData
      Adds a row to this row data.
      Specified by:
      addRow in interface RowData
      Parameters:
      row - the row to add
    • afterLast

      public void afterLast()
      Moves to after last.
      Specified by:
      afterLast in interface RowData
    • beforeFirst

      public void beforeFirst()
      Moves to before first.
      Specified by:
      beforeFirst in interface RowData
    • beforeLast

      public void beforeLast()
      Description copied from interface: RowData
      Moves to before last so next el is the last el.
      Specified by:
      beforeLast in interface RowData
    • close

      public void close()
      Description copied from interface: RowData
      We're done.
      Specified by:
      close in interface RowData
    • getAt

      public ResultSetRow getAt(int atIndex) throws SQLException
      Description copied from interface: RowData
      Only works on non dynamic result sets.
      Specified by:
      getAt in interface RowData
      Parameters:
      atIndex - row number to get at
      Returns:
      row data at index
      Throws:
      SQLException - if a database error occurs
    • getCurrentRowNumber

      public int getCurrentRowNumber()
      Description copied from interface: RowData
      Returns the current position in the result set as a row number.
      Specified by:
      getCurrentRowNumber in interface RowData
      Returns:
      the current row number
    • getOwner

      public ResultSetInternalMethods getOwner()
      Description copied from interface: RowData
      Returns the result set that 'owns' this RowData
      Specified by:
      getOwner in interface RowData
      See Also:
    • hasNext

      public boolean hasNext()
      Description copied from interface: RowData
      Returns true if another row exsists.
      Specified by:
      hasNext in interface RowData
      Returns:
      true if more rows
    • isAfterLast

      public boolean isAfterLast()
      Returns true if we got the last element.
      Specified by:
      isAfterLast in interface RowData
      Returns:
      true if after last row
    • isBeforeFirst

      public boolean isBeforeFirst()
      Returns if iteration has not occurred yet.
      Specified by:
      isBeforeFirst in interface RowData
      Returns:
      true if before first row
    • isDynamic

      public boolean isDynamic()
      Description copied from interface: RowData
      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.
      Specified by:
      isDynamic in interface RowData
      Returns:
      true if this result set is streaming from the server
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: RowData
      Has no records.
      Specified by:
      isEmpty in interface RowData
      Returns:
      true if no records
    • isFirst

      public boolean isFirst()
      Description copied from interface: RowData
      Are we on the first row of the result set?
      Specified by:
      isFirst in interface RowData
      Returns:
      true if on first row
    • isLast

      public boolean isLast()
      Description copied from interface: RowData
      Are we on the last row of the result set?
      Specified by:
      isLast in interface RowData
      Returns:
      true if on last row
    • moveRowRelative

      public void moveRowRelative(int rowsToMove)
      Description copied from interface: RowData
      Moves the current position relative 'rows' from the current position.
      Specified by:
      moveRowRelative in interface RowData
      Parameters:
      rowsToMove - the relative number of rows to move
    • next

      public ResultSetRow next() throws SQLException
      Description copied from interface: RowData
      Returns the next row.
      Specified by:
      next in interface RowData
      Returns:
      the next row value
      Throws:
      SQLException - if a database error occurs
    • removeRow

      public void removeRow(int atIndex)
      Description copied from interface: RowData
      Removes the row at the given index.
      Specified by:
      removeRow in interface RowData
      Parameters:
      atIndex - the row to move to
    • setCurrentRow

      public void setCurrentRow(int newIndex)
      Description copied from interface: RowData
      Moves the current position in the result set to the given row number.
      Specified by:
      setCurrentRow in interface RowData
      Parameters:
      newIndex - row to move to
    • setOwner

      public void setOwner(ResultSetImpl rs)
      Description copied from interface: RowData
      Set the result set that 'owns' this RowData
      Specified by:
      setOwner in interface RowData
      Parameters:
      rs - the result set that 'owns' this RowData
      See Also:
      • invalid reference
        com.mysql.jdbc.RowData#setOwner(com.mysql.jdbc.ResultSetInternalMethods)
    • size

      public int size()
      Description copied from interface: RowData
      Only works on non dynamic result sets.
      Specified by:
      size in interface RowData
      Returns:
      the size of this row data
    • wasEmpty

      public boolean wasEmpty()
      Description copied from interface: RowData
      Did this result set have no rows?
      Specified by:
      wasEmpty in interface RowData
    • setMetadata

      public void setMetadata(Field[] metadata)
      Description copied from interface: RowData
      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.
      Specified by:
      setMetadata in interface RowData
      Parameters:
      metadata - field-level metadata for the result set