org.mariadb.jdbc.internal.queryresults.resultset

## Class MariaSelectResultSet

- java.lang.Object
- - org.mariadb.jdbc.internal.queryresults.resultset.AbstractSelectResultSet
  - - org.mariadb.jdbc.internal.queryresults.resultset.MariaSelectResultSet

All Implemented Interfaces:
  AutoCloseable, ResultSet, Wrapper

    public class MariaSelectResultSet
    extends AbstractSelectResultSet

### Field Summary

Fields
`boolean` `callableResult`
`protected int` `columnInformationLength`
`static MariaSelectResultSet` `EMPTY`
`protected int` `fetchSize`
`protected MariaSelectResultSet` `moreResult`
`protected List<ValueObject[]>` `resultSet`
`protected int` `resultSetScrollType`

### Fields inherited from class org.mariadb.jdbc.internal.queryresults.resultset.AbstractSelectResultSet

`cal, columnNameMap, columnsInformation, isClosed, lastGetWasNull, options, protocol, rowPointer, statement`

### Fields inherited from interface java.sql.ResultSet

`CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE`

### Constructor Summary

Constructors
Constructor and Description
`MariaSelectResultSet(ColumnInformation[] columnInformation, List<ValueObject[]> resultSet, Protocol protocol, int resultSetScrollType)` Create filled resultset.
`MariaSelectResultSet(ColumnInformation[] columnInformation, Statement statement, Protocol protocol, ReadPacketFetcher fetcher, boolean binaryProtocol, int resultSetScrollType, int fetchSize, boolean callableResult)` Create Streaming resultset.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `absolute(int row)`
`void` `afterLast()`
`void` `beforeFirst()`
`void` `clearWarnings()`
`void` `close()` Close resultset.
`static ResultSet` `createGeneratedData(long[] data, Protocol protocol, boolean findColumnReturnsOne)` Create a result set from given data.
`static MariaSelectResultSet` `createResult(Statement statement, ResultSetPacket packet, ReadPacketFetcher packetFetcher, Protocol protocol, boolean binaryProtocol, int resultSetScrollType, int fetchSize, boolean canBeCallableResult)` Create streaming resultset.
`static ResultSet` `createResultSet(String[] columnNames, MariaDbType[] columnTypes, String[][] data, Protocol protocol)` Create a result set from given data.
`boolean` `first()`
`int` `getConcurrency()`
`int` `getFetchDirection()`
`int` `getFetchSize()`
`MariaSelectResultSet` `getMoreResult()`
`int` `getRow()`
`int` `getType()`
`protected ValueObject` `getValueObject(int position)`
`SQLWarning` `getWarnings()`
`void` `initFetch()` Initialize and fetch first value.
`boolean` `isAfterLast()`
`boolean` `isBeforeFirst()`
`boolean` `isBinaryProtocol()`
`boolean` `isCallableResult()`
`boolean` `isFirst()`
`boolean` `isLast()`
`boolean` `last()`
`boolean` `next()`
`boolean` `previous()`
`boolean` `readNextValue(List<ValueObject[]> values)` Read next value.
`boolean` `relative(int rows)`
`void` `setCallableResult(boolean callableResult)`
`void` `setFetchDirection(int direction)`
`void` `setFetchSize(int fetchSize)`
`void` `setMoreResult(MariaSelectResultSet moreResult)`

### Methods inherited from class org.mariadb.jdbc.internal.queryresults.resultset.AbstractSelectResultSet

`cancelRowUpdates, deleteRow, findColumn, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getMetaData, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getObject, getObject, getRef, getRef, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getUnicodeStream, getUnicodeStream, getURL, getURL, insertRow, isClosed, isWrapperFor, moveToCurrentRow, moveToInsertRow, refreshRow, rowDeleted, rowInserted, rowUpdated, setReturnTableAlias, setStatement, unwrap, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.sql.ResultSet

`updateObject, updateObject, updateObject, updateObject`

### Field Detail

#### EMPTY

    public static final MariaSelectResultSet EMPTY

#### columnInformationLength

    protected int columnInformationLength

#### resultSet

    protected List<ValueObject[]> resultSet

#### fetchSize

    protected int fetchSize

#### resultSetScrollType

    protected int resultSetScrollType

#### moreResult

    protected MariaSelectResultSet moreResult

#### callableResult

    public boolean callableResult

### Constructor Detail

#### MariaSelectResultSet

    public MariaSelectResultSet(ColumnInformation[] columnInformation,
                                Statement statement,
                                Protocol protocol,
                                ReadPacketFetcher fetcher,
                                boolean binaryProtocol,
                                int resultSetScrollType,
                                int fetchSize,
                                boolean callableResult)

Create Streaming resultset.

Parameters:
  `columnInformation` - column information
  `statement` - statement
  `protocol` - current protocol
  `fetcher` - stream fetcher
  `binaryProtocol` - is binary protocol ?
  `resultSetScrollType` - one of the following `ResultSet` constants: `ResultSet.TYPE_FORWARD_ONLY`, `ResultSet.TYPE_SCROLL_INSENSITIVE`, or `ResultSet.TYPE_SCROLL_SENSITIVE`
  `fetchSize` - current fetch size
  `callableResult` - is it a callableResult

#### MariaSelectResultSet

    public MariaSelectResultSet(ColumnInformation[] columnInformation,
                                List<ValueObject[]> resultSet,
                                Protocol protocol,
                                int resultSetScrollType)

Create filled resultset.

Parameters:
  `columnInformation` - column information
  `resultSet` - resultset
  `protocol` - current protocol
  `resultSetScrollType` - one of the following `ResultSet` constants: `ResultSet.TYPE_FORWARD_ONLY`, `ResultSet.TYPE_SCROLL_INSENSITIVE`, or `ResultSet.TYPE_SCROLL_SENSITIVE`

### Method Detail

#### createGeneratedData

    public static ResultSet createGeneratedData(long[] data,
                                                Protocol protocol,
                                                boolean findColumnReturnsOne)

Create a result set from given data. Useful for creating "fake" resultsets for DatabaseMetaData, (one example is MariaDbDatabaseMetaData.getTypeInfo())

Parameters:
  `data` - - each element of this array represents a complete row in the ResultSet. Each value is given in its string representation, as in MySQL text protocol, except boolean (BIT(1)) values that are represented as "1" or "0" strings
  `protocol` - protocol
  `findColumnReturnsOne` - - special parameter, used only in generated key result sets
Returns:
  resultset

#### createResultSet

    public static ResultSet createResultSet(String[] columnNames,
                                            MariaDbType[] columnTypes,
                                            String[][] data,
                                            Protocol protocol)

Create a result set from given data. Useful for creating "fake" resultsets for DatabaseMetaData, (one example is MariaDbDatabaseMetaData.getTypeInfo())

Parameters:
  `columnNames` - - string array of column names
  `columnTypes` - - column types
  `data` - - each element of this array represents a complete row in the ResultSet. Each value is given in its string representation, as in MySQL text protocol, except boolean (BIT(1)) values that are represented as "1" or "0" strings
  `protocol` - protocol
Returns:
  resultset

#### createResult

    public static MariaSelectResultSet createResult(Statement statement,
                                                    ResultSetPacket packet,
                                                    ReadPacketFetcher packetFetcher,
                                                    Protocol protocol,
                                                    boolean binaryProtocol,
                                                    int resultSetScrollType,
                                                    int fetchSize,
                                                    boolean canBeCallableResult)
                                             throws IOException,
                                                    QueryException

Create streaming resultset.

Parameters:
  `statement` - current statement
  `packet` - the result set stream from the server
  `packetFetcher` - packetfetcher
  `protocol` - current protocol
  `binaryProtocol` - is the mysql protocol binary
  `resultSetScrollType` - one of the following `ResultSet` constants: `ResultSet.TYPE_FORWARD_ONLY`, `ResultSet.TYPE_SCROLL_INSENSITIVE`, or `ResultSet.TYPE_SCROLL_SENSITIVE`
  `fetchSize` - current fetch size
  `canBeCallableResult` - is this resultset can be an callable output result ? (permit to avoid read the oef ok packet)
Returns:
  an instance of MariaSelectResultSet
Throws:
  `IOException` - when something goes wrong while reading/writing from the server
  `QueryException` - if there is an actual active result on the current connection

#### initFetch

    public void initFetch()
                   throws IOException,
                          QueryException

Initialize and fetch first value.

Throws:
  `IOException` - exception
  `QueryException` - exception

#### isBinaryProtocol

    public boolean isBinaryProtocol()

Specified by:
  `isBinaryProtocol` in class `AbstractSelectResultSet`

#### readNextValue

    public boolean readNextValue(List<ValueObject[]> values)
                          throws IOException,
                                 QueryException

Read next value.

Parameters:
  `values` - values
Returns:
  true if have a new value
Throws:
  `IOException` - exception
  `QueryException` - exception

#### close

    public void close()
               throws SQLException

Close resultset.

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `ResultSet`
Overrides:
  `close` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### next

    public boolean next()
                 throws SQLException

Specified by:
  `next` in interface `ResultSet`
Specified by:
  `next` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### getValueObject

    protected ValueObject getValueObject(int position)
                                  throws SQLException

Specified by:
  `getValueObject` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### getWarnings

    public SQLWarning getWarnings()
                           throws SQLException

Specified by:
  `getWarnings` in interface `ResultSet`
Specified by:
  `getWarnings` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### clearWarnings

    public void clearWarnings()
                       throws SQLException

Specified by:
  `clearWarnings` in interface `ResultSet`
Specified by:
  `clearWarnings` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### isBeforeFirst

    public boolean isBeforeFirst()
                          throws SQLException

Specified by:
  `isBeforeFirst` in interface `ResultSet`
Specified by:
  `isBeforeFirst` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### isAfterLast

    public boolean isAfterLast()
                        throws SQLException

Specified by:
  `isAfterLast` in interface `ResultSet`
Specified by:
  `isAfterLast` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### isFirst

    public boolean isFirst()
                    throws SQLException

Specified by:
  `isFirst` in interface `ResultSet`
Specified by:
  `isFirst` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### isLast

    public boolean isLast()
                   throws SQLException

Specified by:
  `isLast` in interface `ResultSet`
Specified by:
  `isLast` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### beforeFirst

    public void beforeFirst()
                     throws SQLException

Specified by:
  `beforeFirst` in interface `ResultSet`
Specified by:
  `beforeFirst` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### afterLast

    public void afterLast()
                   throws SQLException

Specified by:
  `afterLast` in interface `ResultSet`
Specified by:
  `afterLast` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### first

    public boolean first()
                  throws SQLException

Specified by:
  `first` in interface `ResultSet`
Specified by:
  `first` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### last

    public boolean last()
                 throws SQLException

Specified by:
  `last` in interface `ResultSet`
Specified by:
  `last` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### getRow

    public int getRow()
               throws SQLException

Specified by:
  `getRow` in interface `ResultSet`
Specified by:
  `getRow` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### absolute

    public boolean absolute(int row)
                     throws SQLException

Specified by:
  `absolute` in interface `ResultSet`
Specified by:
  `absolute` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### relative

    public boolean relative(int rows)
                     throws SQLException

Specified by:
  `relative` in interface `ResultSet`
Specified by:
  `relative` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### previous

    public boolean previous()
                     throws SQLException

Specified by:
  `previous` in interface `ResultSet`
Specified by:
  `previous` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### getFetchDirection

    public int getFetchDirection()
                          throws SQLException

Specified by:
  `getFetchDirection` in interface `ResultSet`
Specified by:
  `getFetchDirection` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### setFetchDirection

    public void setFetchDirection(int direction)
                           throws SQLException

Specified by:
  `setFetchDirection` in interface `ResultSet`
Specified by:
  `setFetchDirection` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### getFetchSize

    public int getFetchSize()
                     throws SQLException

Specified by:
  `getFetchSize` in interface `ResultSet`
Specified by:
  `getFetchSize` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### setFetchSize

    public void setFetchSize(int fetchSize)
                      throws SQLException

Specified by:
  `setFetchSize` in interface `ResultSet`
Specified by:
  `setFetchSize` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### getType

    public int getType()
                throws SQLException

Specified by:
  `getType` in interface `ResultSet`
Specified by:
  `getType` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### getConcurrency

    public int getConcurrency()
                       throws SQLException

Specified by:
  `getConcurrency` in interface `ResultSet`
Specified by:
  `getConcurrency` in class `AbstractSelectResultSet`
Throws:
  `SQLException`

#### getMoreResult

    public MariaSelectResultSet getMoreResult()

#### setMoreResult

    public void setMoreResult(MariaSelectResultSet moreResult)

#### isCallableResult

    public boolean isCallableResult()

#### setCallableResult

    public void setCallableResult(boolean callableResult)