org.mariadb.jdbc.internal.queryresults

## Class SingleExecutionResult

- java.lang.Object
- - org.mariadb.jdbc.internal.queryresults.SingleExecutionResult

All Implemented Interfaces:
  ExecutionResult

    public class SingleExecutionResult
    extends Object
    implements ExecutionResult

### Constructor Summary

Constructors
Constructor and Description
`SingleExecutionResult(Statement statement, int fetchSize, boolean selectPossible, boolean canHaveCallableResultset)` Default constructor.
`SingleExecutionResult(Statement statement, int fetchSize, boolean selectPossible, boolean canHaveCallableResultset, boolean canHaveMoreResults)` Constructor with possible multiple results.
`SingleExecutionResult(Statement statement, int fetchSize, boolean selectPossible, boolean canHaveCallableResultset, long affectedRows, long insertId)` Constructor with affected rows and insertIds.
`SingleExecutionResult(Statement statement, int fetchSize, boolean selectPossible, boolean canHaveCallableResultset, MariaSelectResultSet result)` Constructor with additional Resultset.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addResultSet(MariaSelectResultSet result, boolean moreResultAvailable)` Add a resultSet information.
`void` `addStats(long affectedRows, long insertId, boolean moreResultAvailable)` Add execution statistics.
`void` `addStatsError(boolean moreResultAvailable)`
`void` `close()` Close resultset if needed.
`void` `fixStatsError(int sendCommand)`
`long` `getAffectedRows()`
`Deque<ExecutionResult>` `getCachedExecutionResults()`
`int` `getFetchSize()`
`int` `getFirstAffectedRows()`
`long` `getInsertId()`
`long[]` `getInsertIds()`
`MariaSelectResultSet` `getResultSet()`
`Statement` `getStatement()`
`boolean` `hasMoreResultAvailable()`
`boolean` `hasMoreThanOneAffectedRows()`
`boolean` `isCanHaveCallableResultset()`
`boolean` `isSelectPossible()`
`boolean` `isSingleExecutionResult()`
`void` `setFetchSize(int fetchSize)`
`protected void` `setMoreResultAvailable(boolean moreResultAvailable)`

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

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

### Constructor Detail

#### SingleExecutionResult

    public SingleExecutionResult(Statement statement,
                                 int fetchSize,
                                 boolean selectPossible,
                                 boolean canHaveCallableResultset)

Default constructor.

Parameters:
  `statement` - current statement
  `fetchSize` - fetch size
  `selectPossible` - select result possible
  `canHaveCallableResultset` - can be callablestatement

#### SingleExecutionResult

    public SingleExecutionResult(Statement statement,
                                 int fetchSize,
                                 boolean selectPossible,
                                 boolean canHaveCallableResultset,
                                 boolean canHaveMoreResults)

Constructor with possible multiple results.

Parameters:
  `statement` - current statement
  `fetchSize` - fetch size
  `selectPossible` - select result possible
  `canHaveCallableResultset` - can be callablestatement
  `canHaveMoreResults` - tell that results may have multiple resultset

#### SingleExecutionResult

    public SingleExecutionResult(Statement statement,
                                 int fetchSize,
                                 boolean selectPossible,
                                 boolean canHaveCallableResultset,
                                 long affectedRows,
                                 long insertId)

Constructor with affected rows and insertIds.

Parameters:
  `statement` - current statement
  `fetchSize` - fetch size
  `selectPossible` - select result possible
  `canHaveCallableResultset` - can be callablestatement
  `affectedRows` - affected rows
  `insertId` - insert id (auto generated)

#### SingleExecutionResult

    public SingleExecutionResult(Statement statement,
                                 int fetchSize,
                                 boolean selectPossible,
                                 boolean canHaveCallableResultset,
                                 MariaSelectResultSet result)

Constructor with additional Resultset.

Parameters:
  `statement` - current statement
  `fetchSize` - fetch size
  `selectPossible` - select result possible
  `canHaveCallableResultset` - can be callablestatement
  `result` - resultset

### Method Detail

#### addResultSet

    public void addResultSet(MariaSelectResultSet result,
                             boolean moreResultAvailable)

Add a resultSet information.

Specified by:
  `addResultSet` in interface `ExecutionResult`
Parameters:
  `result` - resultset implementation
  `moreResultAvailable` - is there additional packet

#### addStats

    public void addStats(long affectedRows,
                         long insertId,
                         boolean moreResultAvailable)

Add execution statistics.

Specified by:
  `addStats` in interface `ExecutionResult`
Parameters:
  `affectedRows` - number of affected rows
  `insertId` - primary key
  `moreResultAvailable` - is there additional packet

#### getInsertIds

    public long[] getInsertIds()

Specified by:
  `getInsertIds` in interface `ExecutionResult`

#### getInsertId

    public long getInsertId()

#### getAffectedRows

    public long getAffectedRows()

#### hasMoreThanOneAffectedRows

    public boolean hasMoreThanOneAffectedRows()

Specified by:
  `hasMoreThanOneAffectedRows` in interface `ExecutionResult`

#### getFirstAffectedRows

    public int getFirstAffectedRows()

Specified by:
  `getFirstAffectedRows` in interface `ExecutionResult`

#### addStatsError

    public void addStatsError(boolean moreResultAvailable)

Specified by:
  `addStatsError` in interface `ExecutionResult`

#### fixStatsError

    public void fixStatsError(int sendCommand)

Specified by:
  `fixStatsError` in interface `ExecutionResult`

#### getResultSet

    public MariaSelectResultSet getResultSet()

Specified by:
  `getResultSet` in interface `ExecutionResult`

#### getStatement

    public Statement getStatement()

Specified by:
  `getStatement` in interface `ExecutionResult`

#### hasMoreResultAvailable

    public boolean hasMoreResultAvailable()

Specified by:
  `hasMoreResultAvailable` in interface `ExecutionResult`

#### setMoreResultAvailable

    protected void setMoreResultAvailable(boolean moreResultAvailable)

#### getFetchSize

    public int getFetchSize()

Specified by:
  `getFetchSize` in interface `ExecutionResult`

#### setFetchSize

    public void setFetchSize(int fetchSize)

Specified by:
  `setFetchSize` in interface `ExecutionResult`

#### close

    public void close()
               throws SQLException

Close resultset if needed.

Specified by:
  `close` in interface `ExecutionResult`
Throws:
  `SQLException` - if exception occur during resultset close.

#### isSelectPossible

    public boolean isSelectPossible()

Specified by:
  `isSelectPossible` in interface `ExecutionResult`

#### isCanHaveCallableResultset

    public boolean isCanHaveCallableResultset()

Specified by:
  `isCanHaveCallableResultset` in interface `ExecutionResult`

#### getCachedExecutionResults

    public Deque<ExecutionResult> getCachedExecutionResults()

Specified by:
  `getCachedExecutionResults` in interface `ExecutionResult`

#### isSingleExecutionResult

    public boolean isSingleExecutionResult()

Specified by:
  `isSingleExecutionResult` in interface `ExecutionResult`