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 XSQLDA
allocateXSqlDa
(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.RowDescriptor
void
execute
(org.firebirdsql.gds.ng.fields.RowValue parameters) void
fetchRows
(int fetchSize) protected void
free
(int option) int
int
int
byte[]
getSqlInfo
(byte[] requestItems, int bufferLength) protected boolean
isValidTransactionClass
(Class<? extends org.firebirdsql.gds.ng.FbTransaction> transactionClass) void
protected void
setCursorNameImpl
(String cursorName) protected void
setParameterDescriptor
(org.firebirdsql.gds.ng.fields.RowDescriptor parameterDescriptor) protected void
setRowDescriptor
(org.firebirdsql.gds.ng.fields.RowDescriptor fieldDescriptor) 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.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.final org.firebirdsql.gds.ng.LockCloseable
withLock()
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, 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.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:
setParameterDescriptor
in classorg.firebirdsql.gds.ng.AbstractFbStatement
-
setRowDescriptor
protected void setRowDescriptor(org.firebirdsql.gds.ng.fields.RowDescriptor fieldDescriptor) - Overrides:
setRowDescriptor
in classorg.firebirdsql.gds.ng.AbstractFbStatement
-
free
- Specified by:
free
in classorg.firebirdsql.gds.ng.AbstractFbStatement
- Throws:
SQLException
-
isValidTransactionClass
protected boolean isValidTransactionClass(Class<? extends org.firebirdsql.gds.ng.FbTransaction> transactionClass) - Specified by:
isValidTransactionClass
in classorg.firebirdsql.gds.ng.AbstractFbStatement
-
getDatabase
-
getHandle
public int getHandle() -
getTransaction
- Specified by:
getTransaction
in interfaceorg.firebirdsql.gds.ng.FbStatement
- Overrides:
getTransaction
in 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
fetchSize
to 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:
setCursorNameImpl
in classorg.firebirdsql.gds.ng.AbstractFbStatement
- Throws:
SQLException
-
emptyRowDescriptor
public final org.firebirdsql.gds.ng.fields.RowDescriptor emptyRowDescriptor()
-