Package org.mariadb.jdbc.client.result

## Class CompleteResult

- java.lang.Object
- - org.mariadb.jdbc.client.result.Result
  - - org.mariadb.jdbc.client.result.CompleteResult

All Implemented Interfaces:
  `AutoCloseable`, `ResultSet`, `Wrapper`, `org.mariadb.jdbc.client.Completion`, `org.mariadb.jdbc.message.ServerMessage`

Direct Known Subclasses:
  `UpdatableResult`

    public class CompleteResult
    extends Result

Result-set that will retrieve all rows immediately before returning the result-set.

### Field Summary

Fields
`protected static int` `BEFORE_FIRST_POS` before first row position = initial position

### Fields inherited from class org.mariadb.jdbc.client.result.Result

`closed, context, data, dataSize, exceptionFactory, loaded, maxRows, metadataList, outputParameter, reader, resultSetType, row, 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
`CompleteResult​(ColumnDefinitionPacket[] metadataList, byte[][] data, org.mariadb.jdbc.client.Context context)` Specific constructor for internal build result-set, empty resultset, or generated key result-set.
`CompleteResult​(Statement stmt, boolean binaryProtocol, long maxRows, org.mariadb.jdbc.client.Column[] metadataList, Reader reader, org.mariadb.jdbc.client.Context context, int resultSetType, boolean closeOnCompletion, boolean traceEnable)` Constructor from exchanges

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `absolute​(int idx)`
`void` `afterLast()`
`void` `beforeFirst()`
`void` `closeFromStmtClose​(ReentrantLock lock)` Closing result-set due to closing statement that issue command.
`static ResultSet` `createResultSet​(String[] columnNames, org.mariadb.jdbc.client.DataType[] columnTypes, String[][] data, org.mariadb.jdbc.client.Context context)` Create a result set from given data.
`static ResultSet` `createResultSet​(String columnName, org.mariadb.jdbc.client.DataType columnType, String[][] data, org.mariadb.jdbc.client.Context context)` Specific constructor for generating generated key result-set.
`void` `fetchRemaining()` Fetch remaining results.
`boolean` `first()`
`int` `getFetchSize()`
`int` `getRow()`
`boolean` `isAfterLast()`
`boolean` `isFirst()`
`boolean` `isLast()`
`boolean` `last()`
`boolean` `next()` Position resultset to next row
`boolean` `previous()`
`boolean` `relative​(int rows)`
`void` `setFetchSize​(int rows)`
`boolean` `streaming()` Indicate of current result-set is a streaming result-set

### Methods inherited from class org.mariadb.jdbc.client.result.Result

`abort, addRowData, cancelRowUpdates, checkClose, checkNotForwardOnly, clearWarnings, close, deleteRow, findColumn, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCurrentRowData, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, 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, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isBeforeFirst, isClosed, isOutputParameter, isWrapperFor, loaded, moveToCurrentRow, moveToInsertRow, readNext, refreshRow, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setStatement, skipRemaining, 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, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowData, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, useAliasAsName, wasNull`

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

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

### Field Detail

#### BEFORE_FIRST_POS

    protected static final int BEFORE_FIRST_POS

before first row position = initial position

See Also:
  Constant Field Values

### Constructor Detail

#### CompleteResult

    public CompleteResult​(Statement stmt,
                          boolean binaryProtocol,
                          long maxRows,
                          org.mariadb.jdbc.client.Column[] metadataList,
                          Reader reader,
                          org.mariadb.jdbc.client.Context context,
                          int resultSetType,
                          boolean closeOnCompletion,
                          boolean traceEnable)
                   throws IOException,
                          SQLException

Constructor from exchanges

Parameters:
  `stmt` - current statement
  `binaryProtocol` - does exchanges uses binary protocol
  `maxRows` - maximum number of rows
  `metadataList` - metadata
  `reader` - packet reader
  `context` - connection context
  `resultSetType` - result set type
  `closeOnCompletion` - close statement on completion
  `traceEnable` - network trace exchange possible
Throws:
  `IOException` - if Socket error occurs
  `SQLException` - for all other kind of errors

#### CompleteResult

    public CompleteResult​(ColumnDefinitionPacket[] metadataList,
                          byte[][] data,
                          org.mariadb.jdbc.client.Context context)

Specific constructor for internal build result-set, empty resultset, or generated key result-set.

Parameters:
  `metadataList` - metadata
  `data` - result-set data
  `context` - connection context

### Method Detail

#### createResultSet

    public static ResultSet createResultSet​(String columnName,
                                            org.mariadb.jdbc.client.DataType columnType,
                                            String[][] data,
                                            org.mariadb.jdbc.client.Context context)

Specific constructor for generating generated key result-set.

Parameters:
  `columnName` - column key
  `columnType` - column key type
  `data` - values
  `context` - connection context
Returns:
  result-set

#### createResultSet

    public static ResultSet createResultSet​(String[] columnNames,
                                            org.mariadb.jdbc.client.DataType[] columnTypes,
                                            String[][] data,
                                            org.mariadb.jdbc.client.Context context)

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 MariaDB text protocol, except boolean (BIT(1)) values that are represented as "1" or "0" strings
  `context` - connection context
Returns:
  resultset

#### next

    public boolean next()
                 throws SQLException

Description copied from class: `Result`
Position resultset to next row

Specified by:
  `next` in interface `ResultSet`
Specified by:
  `next` in class `Result`
Returns:
  true if next row exists
Throws:
  `SQLException` - if any error occurs

#### streaming

    public boolean streaming()

Description copied from class: `Result`
Indicate of current result-set is a streaming result-set

Specified by:
  `streaming` in class `Result`
Returns:
  if streaming result-set

#### fetchRemaining

    public void fetchRemaining()

Description copied from class: `Result`
Fetch remaining results.

Specified by:
  `fetchRemaining` in class `Result`

#### closeFromStmtClose

    public void closeFromStmtClose​(ReentrantLock lock)

Description copied from class: `Result`
Closing result-set due to closing statement that issue command.

Overrides:
  `closeFromStmtClose` in class `Result`
Parameters:
  `lock` - thread locker object

#### isAfterLast

    public boolean isAfterLast()
                        throws SQLException

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

#### isFirst

    public boolean isFirst()
                    throws SQLException

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

#### isLast

    public boolean isLast()
                   throws SQLException

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

#### beforeFirst

    public void beforeFirst()
                     throws SQLException

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

#### afterLast

    public void afterLast()
                   throws SQLException

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

#### first

    public boolean first()
                  throws SQLException

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

#### last

    public boolean last()
                 throws SQLException

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

#### getRow

    public int getRow()
               throws SQLException

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

#### absolute

    public boolean absolute​(int idx)
                     throws SQLException

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

#### relative

    public boolean relative​(int rows)
                     throws SQLException

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

#### previous

    public boolean previous()
                     throws SQLException

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

#### getFetchSize

    public int getFetchSize()
                     throws SQLException

Throws:
  `SQLException`

#### setFetchSize

    public void setFetchSize​(int rows)
                      throws SQLException

Throws:
  `SQLException`