com.mysql.cj.protocol

## Interface ResultsetRows

All Superinterfaces:
  Iterator<Row>, ProtocolEntity, RowList

    public interface ResultsetRows
    extends RowList, ProtocolEntity

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. It extends the `RowList` functionality by providing row positioning, updatability and ownership.

### Field Summary

### Fields inherited from interface com.mysql.cj.result.RowList

`RESULT_SET_SIZE_UNKNOWN`

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`default void` `addRow(Row row)` Adds a row.
`default void` `afterLast()` Moves to after last.
`default void` `beforeFirst()` Moves to before first.
`default void` `beforeLast()` Moves to before last.
`default void` `close()` We're done.
`ColumnDefinition` `getMetadata()`
`ResultsetRowsOwner` `getOwner()` Returns the result set that 'owns' this RowData
`boolean` `isAfterLast()` Returns true if we got the last element.
`boolean` `isBeforeFirst()` Returns if iteration has not occured yet.
`default boolean` `isDynamic()` Returns true if the result set is dynamic.
`default boolean` `isEmpty()` Has no records.
`default boolean` `isFirst()` Are we on the first row of the result set?
`default boolean` `isLast()` Are we on the last row of the result set?
`default void` `moveRowRelative(int rows)` Moves the current position relative 'rows' from the current position.
`default void` `setCurrentRow(int rowNumber)` Moves the current position in the result set to the given row number.
`void` `setMetadata(ColumnDefinition columnDefinition)` 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` `setOwner(ResultsetRowsOwner rs)` Set the result set that 'owns' this RowData
`boolean` `wasEmpty()` Did this result set have no rows?

### Methods inherited from interface com.mysql.cj.result.RowList

`get, getPosition, previous, size`

### Methods inherited from interface java.util.Iterator

`forEachRemaining, hasNext, next, remove`

### Method Detail

#### addRow

    default void addRow(Row row)

Adds a row.

Parameters:
  `row` - the row to add

#### afterLast

    default void afterLast()

Moves to after last.

#### beforeFirst

    default void beforeFirst()

Moves to before first.

#### beforeLast

    default void beforeLast()

Moves to before last.

#### close

    default void close()

We're done.

#### getOwner

    ResultsetRowsOwner getOwner()

Returns the result set that 'owns' this RowData

Returns:
  `ResultsetRowsOwner`

#### isAfterLast

    boolean isAfterLast()

Returns true if we got the last element.

Returns:
  true if after last row

#### isBeforeFirst

    boolean isBeforeFirst()

Returns if iteration has not occured yet.

Returns:
  true if before first row

#### isDynamic

    default boolean isDynamic()

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

#### isEmpty

    default boolean isEmpty()

Has no records.

Returns:
  true if no records

#### isFirst

    default boolean isFirst()

Are we on the first row of the result set?

Returns:
  true if on first row

#### isLast

    default boolean isLast()

Are we on the last row of the result set?

Returns:
  true if on last row

#### moveRowRelative

    default void moveRowRelative(int rows)

Moves the current position relative 'rows' from the current position.

Parameters:
  `rows` - the relative number of rows to move

#### setCurrentRow

    default void setCurrentRow(int rowNumber)

Moves the current position in the result set to the given row number.

Parameters:
  `rowNumber` - row to move to

#### setOwner

    void setOwner(ResultsetRowsOwner rs)

Set the result set that 'owns' this RowData

Parameters:
  `rs` - the result set that 'owns' this RowData

#### wasEmpty

    boolean wasEmpty()

Did this result set have no rows?

Returns:
  true if the result set did not have rows

#### setMetadata

    void setMetadata(ColumnDefinition columnDefinition)

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:
  `columnDefinition` - field-level metadata for the result set

#### getMetadata

    ColumnDefinition getMetadata()

Copyright © 2016, 2024, Oracle and/or its affiliates.