public abstract class AbstractFbWireStatement extends AbstractFbStatement implements FbWireStatement
exceptionListenerDispatcher, statementListenerDispatcher| Constructor and Description |
|---|
AbstractFbWireStatement(FbWireDatabase database) |
| Modifier and Type | Method and Description |
|---|---|
protected byte[] |
calculateBlr(RowDescriptor rowDescriptor)
Returns the (possibly cached) blr byte array for a
RowDescriptor, or null if the parameter is null. |
protected byte[] |
calculateBlr(RowDescriptor rowDescriptor,
RowValue rowValue)
Returns the blr byte array for a
RowValue, or null if the parameter is null. |
void |
close()
Close and deallocate this statement.
|
RowDescriptor |
emptyRowDescriptor() |
protected BlrCalculator |
getBlrCalculator() |
FbWireDatabase |
getDatabase() |
int |
getHandle() |
protected byte[] |
getInfo(int operation,
byte[] requestItems,
int bufferLength) |
byte[] |
getSqlInfo(byte[] requestItems,
int bufferLength)
Request statement info.
|
protected XdrInputStream |
getXdrIn()
Gets the XdrInputStream.
|
protected XdrOutputStream |
getXdrOut()
Gets the XdrOutputStream.
|
protected boolean |
isValidTransactionClass(java.lang.Class<? extends FbTransaction> transactionClass)
Method to decide if a transaction implementation class is valid for the statement implementation.
|
protected void |
setHandle(int handle) |
LockCloseable |
withLock()
Locks the lock with
Lock.lock() (or equivalent). |
protected <T> DeferredAction |
wrapDeferredResponse(DeferredResponse<T> deferredResponse,
java.util.function.Function<Response,T> responseMapper)
Wraps a deferred response to produce a deferred action that can be added
using
FbWireDatabase.enqueueDeferredAction(DeferredAction), notifying the exception listener of this
statement for exceptions, and forcing the ERROR state for IO errors. |
addExceptionListener, addStatementListener, checkStatementValid, checkStatementValid, closeCursor, closeCursor, createExecutionPlanProcessor, createSqlCountProcessor, ensureClosedCursor, fetchScroll, fetchScrollImpl, finalize, forceState, free, getAllowedTimeout, getCursorInfo, getCursorInfo, getCursorInfoImpl, 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, reset, resetAll, setAfterLast, setBeforeFirst, setParameterDescriptor, setRowDescriptor, setTimeout, setTransaction, setType, signalExecute, signalFetch, switchState, unprepare, validateParametersclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddStatementListener, batchCancel, batchExecute, clearCursorFlag, closeCursor, closeCursor, createBatchParameterBuffer, deferredBatchCreate, deferredBatchRelease, deferredBatchSend, ensureClosedCursor, execute, fetchRows, fetchScroll, getCursorInfo, getCursorInfo, getDefaultSqlInfoSize, getExecutionPlan, getExplainedExecutionPlan, getMaxSqlInfoSize, getParameterDescriptor, getRowDescriptor, getSqlCounts, getSqlInfo, getState, getTimeout, getTransaction, getType, hasFetched, isCursorFlagSet, prepare, removeStatementListener, setCursorFlag, setCursorName, setTimeout, setTransaction, supportBatchUpdates, supportsCursorInfo, supportsFetchScroll, unprepare, validateParametersaddExceptionListener, removeExceptionListenerpublic AbstractFbWireStatement(FbWireDatabase database)
public final LockCloseable withLock()
FbStatementLock.lock() (or equivalent).
Implementations are expected to apply the same lock as FbAttachment.withLock().
withLock in interface FbStatementFbAttachment.withLock()protected final XdrInputStream getXdrIn() throws java.sql.SQLException
java.sql.SQLException - If no connection is opened or when exceptions occur
retrieving the InputStreamprotected final XdrOutputStream getXdrOut() throws java.sql.SQLException
java.sql.SQLException - If no connection is opened or when exceptions occur
retrieving the OutputStreampublic final FbWireDatabase getDatabase()
getDatabase in interface FbStatementpublic final int getHandle()
getHandle in interface FbStatementprotected final void setHandle(int handle)
protected final byte[] calculateBlr(RowDescriptor rowDescriptor) throws java.sql.SQLException
RowDescriptor, or null if the parameter is null.rowDescriptor - The row descriptor.null when rowDescriptor is nulljava.sql.SQLException - When the RowDescriptor contains an unsupported field type.protected final byte[] calculateBlr(RowDescriptor rowDescriptor, RowValue rowValue) throws java.sql.SQLException
RowValue, or null if the parameter is null.
Contrary to calculateBlr(org.firebirdsql.gds.ng.fields.RowDescriptor), it is not allowed
to cache this value as it depends on the actual row value.
rowValue - The row value.null when rowValue is nulljava.sql.SQLException - When the RowValue contains an unsupported field type.protected final BlrCalculator getBlrCalculator()
BlrCalculator instance for this statement (currently always the one from
the FbWireDatabase instance).public void close()
throws java.sql.SQLException
FbStatementclose in interface java.lang.AutoCloseableclose in interface FbStatementclose in class AbstractFbStatementjava.sql.SQLExceptionprotected boolean isValidTransactionClass(java.lang.Class<? extends FbTransaction> transactionClass)
AbstractFbStatement
Eg a V10Statement will only work with an
FbWireTransaction implementation.
isValidTransactionClass in class AbstractFbStatementtransactionClass - Class of the transactiontrue when the transaction class is valid for the statement implementation.public final RowDescriptor emptyRowDescriptor()
emptyRowDescriptor in interface FbStatementpublic byte[] getSqlInfo(byte[] requestItems,
int bufferLength)
throws java.sql.SQLException
FbStatementgetSqlInfo in interface FbStatementrequestItems - Array of info items to requestbufferLength - Response buffer length to usejava.sql.SQLException - For errors retrieving or transforming the response.protected byte[] getInfo(int operation,
byte[] requestItems,
int bufferLength)
throws java.sql.SQLException
java.sql.SQLExceptionprotected final <T> DeferredAction wrapDeferredResponse(DeferredResponse<T> deferredResponse, java.util.function.Function<Response,T> responseMapper)
FbWireDatabase.enqueueDeferredAction(DeferredAction), notifying the exception listener of this
statement for exceptions, and forcing the ERROR state for IO errors.T - type of deferred responsedeferredResponse - deferred response to wrapresponseMapper - Function to map a Response to the response object expected by the deferred responseCopyright © 2001-2023 Jaybird (Firebird JDBC) team. All rights reserved.