- All Implemented Interfaces:
AutoCloseable
,FbStatement
,ExceptionListenable
,FbWireStatement
- Direct Known Subclasses:
V12Statement
FbWireStatement
implementation for the version 11 wire protocol.- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Field Summary
FieldsFields inherited from class org.firebirdsql.gds.ng.AbstractFbStatement
exceptionListenerDispatcher, statementListenerDispatcher
-
Constructor Summary
ConstructorsConstructorDescriptionV11Statement
(FbWireDatabase database) Creates a new instance of V11Statement for the specified database. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
asyncFetchRows
(int fetchSize) Requests the server to perform an asynchronous fetch forfetch size
.protected boolean
Completes a pending async fetch.void
fetchRows
(int fetchSize) Requests this statement to fetch the nextfetchSize
rows.protected void
free
(int option) Frees the currently allocated statement.void
Prepare the statement text.protected void
reset
(boolean resetAll) Resets the statement for next execution.Methods inherited from class org.firebirdsql.gds.ng.wire.version10.V10Statement
doFreePacket, execute, getDefaultSqlInfoSize, getMaxSqlInfoSize, processAllocateResponse, processExecuteResponse, processExecuteSingletonResponse, processFetchResponse, processFetchResponse, processFreeResponse, processPrepareResponse, readColumnData, readSqlData, sendAllocate, sendExecute, sendFetch, sendFree, sendPrepare, setCursorNameImpl, writeColumnData, writeSqlData
Methods inherited from class org.firebirdsql.gds.ng.wire.AbstractFbWireStatement
calculateBlr, calculateBlr, close, emptyRowDescriptor, getBlrCalculator, getDatabase, getHandle, getInfo, getSqlInfo, getXdrIn, getXdrOut, isValidTransactionClass, setHandle, withLock, wrapDeferredResponse
Methods inherited from class org.firebirdsql.gds.ng.AbstractFbStatement
addExceptionListener, addStatementListener, addWeakStatementListener, checkFetchSize, checkPrepareAllowed, checkStatementHasOpenCursor, checkStatementValid, checkStatementValid, closeCursor, closeCursor, createExecutionPlanProcessor, createSqlCountProcessor, ensureClosedCursor, fetchScroll, fetchScrollImpl, forceState, getAllowedTimeout, getCursorInfo, getCursorInfo, getCursorInfoImpl, getCursorName, getExecutionPlan, getExplainedExecutionPlan, getParameterDescriptionInfoRequestItems, getParameterDescriptor, getRowDescriptor, getSqlCounts, getSqlInfo, getState, getStatementInfoRequestItems, getStatementWarningCallback, getTimeout, getTransaction, getTransactionListener, getType, hasFetched, hasFields, hasSingletonResult, isAfterLast, isBeforeFirst, isPrepareAllowed, parseStatementInfo, queueRowData, removeExceptionListener, removeStatementListener, reset, resetAll, setAfterLast, setBeforeFirst, setCursorName, setParameterDescriptor, setRowDescriptor, setTimeout, setTransaction, setType, signalAsyncFetchComplete, signalAsyncFetchStart, signalExecute, signalFetch, switchState, unprepare, validateParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenable
addExceptionListener, removeExceptionListener
Methods inherited from interface org.firebirdsql.gds.ng.FbStatement
addStatementListener, addWeakStatementListener, batchCancel, batchExecute, clearCursorFlag, close, closeCursor, closeCursor, createBatchParameterBuffer, deferredBatchCreate, deferredBatchRelease, deferredBatchSend, emptyRowDescriptor, ensureClosedCursor, fetchScroll, getCursorInfo, getCursorInfo, getDatabase, getExecutionPlan, getExplainedExecutionPlan, getHandle, getParameterDescriptor, getRowDescriptor, getSqlCounts, getSqlInfo, getSqlInfo, getState, getTimeout, getTransaction, getType, hasFetched, isCursorFlagSet, removeStatementListener, setCursorFlag, setCursorName, setTimeout, setTransaction, supportBatchUpdates, supportsCursorInfo, supportsFetchScroll, unprepare, validateParameters, withLock
-
Field Details
-
asyncFetchStatus
-
-
Constructor Details
-
V11Statement
Creates a new instance of V11Statement for the specified database.- Parameters:
database
- FbWireDatabase implementation
-
-
Method Details
-
prepare
Description copied from interface:FbStatement
Prepare the statement text.If this handle is in state
StatementState.NEW
then it will first allocate the statement.- Specified by:
prepare
in interfaceFbStatement
- Overrides:
prepare
in classV10Statement
- Parameters:
statementText
- Statement text- Throws:
SQLException
- If a database access error occurs, or this statement is currently executing a query.
-
fetchRows
Description copied from interface:FbStatement
Requests this statement to fetch the nextfetchSize
rows.Fetched rows are not returned from this method, but sent to the registered
StatementListener
instances.If an asynchronous fetch is pending, that pending fetch should be completed instead of performing a new fetch.
- Specified by:
fetchRows
in interfaceFbStatement
- Overrides:
fetchRows
in classV10Statement
- Parameters:
fetchSize
- Number of rows to fetch (must be greater than0
)- Throws:
SQLException
- For database access errors, when called on a closed statement, when no cursor is open or when the fetch size is not greater than0
- See Also:
-
asyncFetchRows
Description copied from interface:FbStatement
Requests the server to perform an asynchronous fetch forfetch size
.Asynchronous fetching is an optional feature. If an implementation does not support asynchronous fetching, it should return immediately and do nothing. Although this interface provides a default implementation which does nothing, implementations should override it, to throw an exception when called on a closed statement.
For implementations which do support async fetching, this call should not do anything if one of the following is true:
- an asynchronous fetch is already pending
fetchSize
is1
or the statement has a cursor name set- the current statement has a scrollable cursor (flag
CURSOR_TYPE_SCROLLABLE
set) - the connection property
asyncFetch
isfalse
An asynchronous fetch can be completed explicitly by calling
FbStatement.fetchRows(int)
, or implicitly by other network operations.- Specified by:
asyncFetchRows
in interfaceFbStatement
- Overrides:
asyncFetchRows
in classAbstractFbStatement
- Parameters:
fetchSize
- number of rows to fetch (must be greater than0
)- Throws:
SQLException
- for database access errors, when called on a closed statement, when no cursor is open or when the fetch size is not greater than0
- See Also:
-
completeAsyncFetch
Completes a pending async fetch.- Returns:
true
if a pending async fetch was processed,false
if there was no pending async fetch.- Throws:
SQLException
- from unsuccessfully completed async fetch, or for errors try to complete deferred actions- Since:
- 6
-
free
Description copied from class:AbstractFbStatement
Frees the currently allocated statement. Either close the cursor withISCConstants.DSQL_close
or drop the statement handle usingISCConstants.DSQL_drop
.- Overrides:
free
in classV10Statement
- Parameters:
option
- Free option- Throws:
SQLException
-
reset
protected void reset(boolean resetAll) Description copied from class:AbstractFbStatement
Resets the statement for next execution. Implementation in derived class must lock onFbStatement.withLock()
and callsuper.reset(resetAll)
- Overrides:
reset
in classAbstractFbStatement
- Parameters:
resetAll
- Also reset field and parameter info
-