- 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 voidasyncFetchRows(int fetchSize) Requests the server to perform an asynchronous fetch forfetch size.protected booleanCompletes a pending async fetch.voidfetchRows(int fetchSize) Requests this statement to fetch the nextfetchSizerows.protected voidfree(int option) Frees the currently allocated statement.voidPrepare the statement text.protected voidreset(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, writeSqlDataMethods inherited from class org.firebirdsql.gds.ng.wire.AbstractFbWireStatement
calculateBlr, calculateBlr, close, emptyRowDescriptor, getBlrCalculator, getDatabase, getHandle, getInfo, getSqlInfo, getXdrIn, getXdrOut, isValidTransactionClass, setHandle, withLock, wrapDeferredResponseMethods 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, validateParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenable
addExceptionListener, removeExceptionListenerMethods 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:FbStatementPrepare the statement text.If this handle is in state
StatementState.NEWthen it will first allocate the statement.- Specified by:
preparein interfaceFbStatement- Overrides:
preparein 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:FbStatementRequests this statement to fetch the nextfetchSizerows.Fetched rows are not returned from this method, but sent to the registered
StatementListenerinstances.If an asynchronous fetch is pending, that pending fetch should be completed instead of performing a new fetch.
- Specified by:
fetchRowsin interfaceFbStatement- Overrides:
fetchRowsin 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:FbStatementRequests 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
fetchSizeis1or the statement has a cursor name set- the current statement has a scrollable cursor (flag
CURSOR_TYPE_SCROLLABLEset) - the connection property
asyncFetchisfalse
An asynchronous fetch can be completed explicitly by calling
FbStatement.fetchRows(int), or implicitly by other network operations.- Specified by:
asyncFetchRowsin interfaceFbStatement- Overrides:
asyncFetchRowsin 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:
trueif a pending async fetch was processed,falseif 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:AbstractFbStatementFrees the currently allocated statement. Either close the cursor withISCConstants.DSQL_closeor drop the statement handle usingISCConstants.DSQL_drop.- Overrides:
freein classV10Statement- Parameters:
option- Free option- Throws:
SQLException
-
reset
protected void reset(boolean resetAll) Description copied from class:AbstractFbStatementResets the statement for next execution. Implementation in derived class must lock onFbStatement.withLock()and callsuper.reset(resetAll)- Overrides:
resetin classAbstractFbStatement- Parameters:
resetAll- Also reset field and parameter info
-