java.lang.Object
org.firebirdsql.gds.ng.AbstractFbStatement
org.firebirdsql.gds.ng.jna.JnaStatement
- All Implemented Interfaces:
AutoCloseable,org.firebirdsql.gds.ng.FbStatement,org.firebirdsql.gds.ng.listeners.ExceptionListenable
public class JnaStatement
extends org.firebirdsql.gds.ng.AbstractFbStatement
Implementation of
FbStatement for native client access.- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Field Summary
Fields inherited from class org.firebirdsql.gds.ng.AbstractFbStatement
exceptionListenerDispatcher, statementListenerDispatcher -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected XSQLDAallocateXSqlDa(org.firebirdsql.gds.ng.fields.RowDescriptor rowDescriptor) Creates an XSQLDA, populates type information and allocates memory for the sqldata fields.final org.firebirdsql.gds.ng.fields.RowDescriptorvoidexecute(org.firebirdsql.gds.ng.fields.RowValue parameters) voidfetchRows(int fetchSize) protected voidfree(int option) intintintbyte[]getSqlInfo(byte[] requestItems, int bufferLength) protected booleanisValidTransactionClass(Class<? extends org.firebirdsql.gds.ng.FbTransaction> transactionClass) voidprotected voidsetCursorNameImpl(String cursorName) protected voidsetParameterDescriptor(org.firebirdsql.gds.ng.fields.RowDescriptor parameterDescriptor) protected voidsetRowDescriptor(org.firebirdsql.gds.ng.fields.RowDescriptor fieldDescriptor) protected voidsetXSqlDaData(XSQLDA xSqlDa, org.firebirdsql.gds.ng.fields.RowDescriptor rowDescriptor, org.firebirdsql.gds.ng.fields.RowValue parameters) Populates an XSQLDA from the row descriptor and parameter values.protected org.firebirdsql.gds.ng.fields.RowValuetoRowValue(org.firebirdsql.gds.ng.fields.RowDescriptor rowDescriptor, XSQLDA xSqlDa) Converts the data from an XSQLDA to a RowValue.final org.firebirdsql.gds.ng.LockCloseablewithLock()Methods inherited from class org.firebirdsql.gds.ng.AbstractFbStatement
addExceptionListener, addStatementListener, addWeakStatementListener, asyncFetchRows, checkFetchSize, checkPrepareAllowed, checkStatementHasOpenCursor, checkStatementValid, checkStatementValid, close, closeCursor, closeCursor, createExecutionPlanProcessor, createSqlCountProcessor, ensureClosedCursor, fetchScroll, fetchScrollImpl, forceState, getAllowedTimeout, getCursorInfo, getCursorInfo, getCursorInfoImpl, getCursorName, 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, setCursorName, 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.FbStatement
batchCancel, batchExecute, clearCursorFlag, createBatchParameterBuffer, deferredBatchCreate, deferredBatchRelease, deferredBatchSend, isCursorFlagSet, setCursorFlag, supportBatchUpdates, supportsCursorInfo, supportsFetchScroll
-
Constructor Details
-
JnaStatement
-
-
Method Details
-
withLock
public final org.firebirdsql.gds.ng.LockCloseable withLock() -
setParameterDescriptor
protected void setParameterDescriptor(org.firebirdsql.gds.ng.fields.RowDescriptor parameterDescriptor) - Overrides:
setParameterDescriptorin classorg.firebirdsql.gds.ng.AbstractFbStatement
-
setRowDescriptor
protected void setRowDescriptor(org.firebirdsql.gds.ng.fields.RowDescriptor fieldDescriptor) - Overrides:
setRowDescriptorin classorg.firebirdsql.gds.ng.AbstractFbStatement
-
free
- Specified by:
freein classorg.firebirdsql.gds.ng.AbstractFbStatement- Throws:
SQLException
-
isValidTransactionClass
protected boolean isValidTransactionClass(Class<? extends org.firebirdsql.gds.ng.FbTransaction> transactionClass) - Specified by:
isValidTransactionClassin classorg.firebirdsql.gds.ng.AbstractFbStatement
-
getDatabase
-
getHandle
public int getHandle() -
getTransaction
- Specified by:
getTransactionin interfaceorg.firebirdsql.gds.ng.FbStatement- Overrides:
getTransactionin classorg.firebirdsql.gds.ng.AbstractFbStatement
-
prepare
- Throws:
SQLException
-
execute
- Throws:
SQLException
-
setXSqlDaData
protected void setXSqlDaData(XSQLDA xSqlDa, org.firebirdsql.gds.ng.fields.RowDescriptor rowDescriptor, org.firebirdsql.gds.ng.fields.RowValue parameters) Populates an XSQLDA from the row descriptor and parameter values.- Parameters:
xSqlDa- XSQLDArowDescriptor- Row descriptorparameters- Parameter values
-
allocateXSqlDa
Creates an XSQLDA, populates type information and allocates memory for the sqldata fields.- Parameters:
rowDescriptor- The row descriptor- Returns:
- Allocated XSQLDA without data
-
toRowValue
protected org.firebirdsql.gds.ng.fields.RowValue toRowValue(org.firebirdsql.gds.ng.fields.RowDescriptor rowDescriptor, XSQLDA xSqlDa) Converts the data from an XSQLDA to a RowValue.- Parameters:
rowDescriptor- Row descriptorxSqlDa- XSQLDA- Returns:
- Row value
-
fetchRows
The JNA implementation ignores the specified
fetchSizeto prevent problems with - for example - positioned updates with named cursors. For the wire protocol that case is handled by the server ignoring the fetch size. Internally the native fetch will batch a number of records, but the number is outside our control.- Throws:
SQLException
-
getSqlInfo
- Throws:
SQLException
-
getDefaultSqlInfoSize
public int getDefaultSqlInfoSize() -
getMaxSqlInfoSize
public int getMaxSqlInfoSize() -
setCursorNameImpl
- Specified by:
setCursorNameImplin classorg.firebirdsql.gds.ng.AbstractFbStatement- Throws:
SQLException
-
emptyRowDescriptor
public final org.firebirdsql.gds.ng.fields.RowDescriptor emptyRowDescriptor()
-