org.firebirdsql.gds.ng.wire.version18

## Class V18Statement

- java.lang.Object
- - org.firebirdsql.gds.ng.AbstractFbStatement
  - - org.firebirdsql.gds.ng.wire.AbstractFbWireStatement
    - - org.firebirdsql.gds.ng.wire.version10.V10Statement
      - - org.firebirdsql.gds.ng.wire.version11.V11Statement
        - - org.firebirdsql.gds.ng.wire.version12.V12Statement
          - - org.firebirdsql.gds.ng.wire.version13.V13Statement
            - - org.firebirdsql.gds.ng.wire.version16.V16Statement
              - - org.firebirdsql.gds.ng.wire.version18.V18Statement

All Implemented Interfaces:
  java.lang.AutoCloseable, FbStatement, ExceptionListenable, FbWireStatement

Direct Known Subclasses:
  V19Statement

    public class V18Statement
    extends V16Statement

Since:
  5
Author:
  Mark Rotteveel

### Field Summary

### Fields inherited from class org.firebirdsql.gds.ng.AbstractFbStatement

`exceptionListenerDispatcher, statementListenerDispatcher`

### Constructor Summary

Constructors
Constructor and Description
`V18Statement(FbWireDatabase database)` Creates a new instance of V18Statement for the specified database.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `clearCursorFlag(CursorFlag flag)` Clears cursor flag.
`protected void` `fetchScrollImpl(FetchType fetchType, int fetchSize, int position)` Implementation of `AbstractFbStatement.fetchScroll(FetchType, int, int)`.
`protected int` `getCursorFlagsAsInt()`
`protected byte[]` `getCursorInfoImpl(byte[] requestItems, int bufferLength)` Implementation of `AbstractFbStatement.getCursorInfo(byte[], int)`.
`boolean` `isCursorFlagSet(CursorFlag flag)` Reports whether a cursor flag is set.
`protected void` `sendExecuteMsg(XdrOutputStream xdrOut, int operation, RowValue parameters)` Sends the execute message (struct `p_sqldata`) to the server, without flushing.
`protected void` `sendFetchScroll(FetchType fetchType, int fetchSize, int position)`
`void` `setCursorFlag(CursorFlag flag)` Set cursor flag.
`boolean` `supportsCursorInfo()` Reports whether this statement implementation supports `FbStatement.getCursorInfo(byte[], int, InfoProcessor)` and `FbStatement.getCursorInfo(byte[], int)`.
`boolean` `supportsFetchScroll()` Reports whether this statement implementation supports `FbStatement.fetchScroll(FetchType, int, int)` with anything other than `FetchType.NEXT`.

### Methods inherited from class org.firebirdsql.gds.ng.wire.version16.V16Statement

`batchCancel, batchExecute, createBatchParameterBuffer, deferredBatchCreate, deferredBatchRelease, deferredBatchSend, sendBatchCreate, sendBatchMsg, supportBatchUpdates`

### Methods inherited from class org.firebirdsql.gds.ng.wire.version13.V13Statement

`getDefaultSqlInfoSize, getMaxSqlInfoSize, readSqlData, writeSqlData, writeSqlData`

### Methods inherited from class org.firebirdsql.gds.ng.wire.version11.V11Statement

`free, prepare`

### Methods inherited from class org.firebirdsql.gds.ng.wire.version10.V10Statement

`doFreePacket, execute, fetchRows, processAllocateResponse, processExecuteResponse, processExecuteSingletonResponse, processFetchResponse, processFreeResponse, processPrepareResponse, readColumnData, sendAllocate, sendExecute, sendFetch, sendFree, sendPrepare, setCursorName, writeColumnData`

### Methods inherited from class org.firebirdsql.gds.ng.wire.AbstractFbWireStatement

`calculateBlr, calculateBlr, close, emptyRowDescriptor, getBlrCalculator, getDatabase, getHandle, getInfo, getSqlInfo, getTransaction, getXdrIn, getXdrOut, handleInlineBlobResponse, isValidTransactionClass, setHandle, withLock, withTransmitLock, wrapDeferredResponse`

### Methods inherited from class org.firebirdsql.gds.ng.AbstractFbStatement

`addExceptionListener, addStatementListener, checkStatementValid, checkStatementValid, closeCursor, closeCursor, createExecutionPlanProcessor, createSqlCountProcessor, ensureClosedCursor, fetchScroll, finalize, forceState, getAllowedTimeout, getCursorInfo, getCursorInfo, getExecutionPlan, getExplainedExecutionPlan, getParameterDescriptionInfoRequestItems, getParameterDescriptor, getRowDescriptor, getSqlCounts, getSqlInfo, getState, getStatementInfoRequestItems, getStatementWarningCallback, getTimeout, getTransactionListener, getType, hasFetched, hasFields, hasSingletonResult, isAfterLast, isBeforeFirst, isPrepareAllowed, parseStatementInfo, queueRowData, removeExceptionListener, removeStatementListener, reset, reset, resetAll, setAfterLast, setBeforeFirst, setParameterDescriptor, setRowDescriptor, setTimeout, setTransaction, setType, signalExecute, signalFetch, switchState, unprepare, validateParameters`

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

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

### Methods inherited from interface org.firebirdsql.gds.ng.FbStatement

`addStatementListener, close, closeCursor, closeCursor, emptyRowDescriptor, ensureClosedCursor, fetchScroll, getCursorInfo, getCursorInfo, getDatabase, getExecutionPlan, getExplainedExecutionPlan, getHandle, getParameterDescriptor, getRowDescriptor, getSqlCounts, getSqlInfo, getSqlInfo, getState, getTimeout, getTransaction, getType, hasFetched, removeStatementListener, setTimeout, setTransaction, unprepare, validateParameters, withLock`

### Methods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenable

`addExceptionListener, removeExceptionListener`

### Constructor Detail

#### V18Statement

    public V18Statement(FbWireDatabase database)

Creates a new instance of V18Statement for the specified database.

Parameters:
  `database` - FbWireDatabase implementation

### Method Detail

#### sendExecuteMsg

    protected void sendExecuteMsg(XdrOutputStream xdrOut,
                                  int operation,
                                  RowValue parameters)
                           throws java.io.IOException,
                                  java.sql.SQLException

Description copied from class: `V10Statement`
Sends the execute message (struct `p_sqldata`) to the server, without flushing.

The caller is responsible for obtaining and releasing the transmit lock.

Overrides:
  `sendExecuteMsg` in class `V16Statement`
Parameters:
  `xdrOut` - XDR output stream
  `operation` - operation (`op_execute` or `op_execute2`)
  `parameters` - parameter values
Throws:
  `java.io.IOException`
  `java.sql.SQLException`

#### fetchScrollImpl

    protected void fetchScrollImpl(FetchType fetchType,
                                   int fetchSize,
                                   int position)
                            throws java.sql.SQLException

Description copied from class: `AbstractFbStatement`
Implementation of `AbstractFbStatement.fetchScroll(FetchType, int, int)`.

An implementation should not notify `exceptionListenerDispatcher`, as that is already handled in `AbstractFbStatement.fetchScroll(FetchType, int, int)`.

The implementation of `AbstractFbStatement.fetchScroll(FetchType, int, int)` redirects `FetchType.NEXT` to `FbStatement.fetchRows(int)`. The implementation does need to handle `NEXT`, but only when actually implementing the other scroll direction.

Overrides:
  `fetchScrollImpl` in class `AbstractFbStatement`
Throws:
  `java.sql.SQLFeatureNotSupportedException` - If the protocol version or the implementation does not support scroll fetch (even for `NEXT`)
  `java.sql.SQLException` - For database access errors, when called on a closed statement, when no cursor is open, or for serverside error conditions
See Also:
  `AbstractFbStatement.fetchScroll(FetchType, int, int)`, `FbStatement.supportsFetchScroll()`

#### sendFetchScroll

    protected void sendFetchScroll(FetchType fetchType,
                                   int fetchSize,
                                   int position)
                            throws java.sql.SQLException,
                                   java.io.IOException

Throws:
  `java.sql.SQLException`
  `java.io.IOException`

#### getCursorInfoImpl

    protected byte[] getCursorInfoImpl(byte[] requestItems,
                                       int bufferLength)
                                throws java.sql.SQLException

Description copied from class: `AbstractFbStatement`
Implementation of `AbstractFbStatement.getCursorInfo(byte[], int)`.

An implementation should not notify `exceptionListenerDispatcher`, as that is already handled in `AbstractFbStatement.getCursorInfo(byte[], int)`.

Overrides:
  `getCursorInfoImpl` in class `AbstractFbStatement`
Throws:
  `java.sql.SQLException` - For errors retrieving or transforming the response
  `java.sql.SQLFeatureNotSupportedException` - If requesting cursor info is not supported (Firebird 4.0 or earlier, or native implementation)
See Also:
  `AbstractFbStatement.getCursorInfo(byte[], int)`, `FbStatement.supportsCursorInfo()`

#### supportsFetchScroll

    public boolean supportsFetchScroll()

Description copied from interface: `FbStatement`
Reports whether this statement implementation supports `FbStatement.fetchScroll(FetchType, int, int)` with anything other than `FetchType.NEXT`.

Returns:
  `true` `fetchScroll` supported, `false` if not supported (default implementation returns `false`)

#### supportsCursorInfo

    public boolean supportsCursorInfo()

Description copied from interface: `FbStatement`
Reports whether this statement implementation supports `FbStatement.getCursorInfo(byte[], int, InfoProcessor)` and `FbStatement.getCursorInfo(byte[], int)`.

Returns:
  `true` `getCursorInfo` supported, `false` if not supported (default implementation returns `false`)

#### getCursorFlagsAsInt

    protected final int getCursorFlagsAsInt()

#### setCursorFlag

    public final void setCursorFlag(CursorFlag flag)

Description copied from interface: `FbStatement`
Set cursor flag.

If a protocol version does not support cursor flags, this is silently ignored.

Parameters:
  `flag` - Cursor flag to set

#### clearCursorFlag

    public final void clearCursorFlag(CursorFlag flag)

Description copied from interface: `FbStatement`
Clears cursor flag.

Setting a cursor flag only affects subsequent executes. A currently open cursor will not be affected.

If a protocol version does not support cursor flags, this is silently ignored.

Parameters:
  `flag` - Cursor flag to clear

#### isCursorFlagSet

    public final boolean isCursorFlagSet(CursorFlag flag)

Description copied from interface: `FbStatement`
Reports whether a cursor flag is set.

If a protocol version does not support cursor flags, `false` should be returned.

Parameters:
  `flag` - Cursor flag
Returns:
  `true` when set, `false` otherwise