public final class JnaService extends AbstractFbService<JnaServiceConnection> implements JnaAttachment
FbService for native client access.| Modifier and Type | Field and Description |
|---|---|
static int |
STATUS_VECTOR_SIZE |
serviceListenerDispatcherconnection, exceptionListenerDispatcher| Constructor and Description |
|---|
JnaService(JnaServiceConnection connection) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterAttachActions()
Additional tasks to execute directly after attach operation.
|
void |
attach()
Attach to the attachment type.
|
protected void |
checkConnected()
Checks if the attachment is connected, and throws a
SQLException if it isn't connected. |
ServiceParameterBuffer |
createServiceParameterBuffer()
Creates an empty
ServiceParameterBuffer. |
ServiceRequestBuffer |
createServiceRequestBuffer() |
protected void |
finalize() |
int |
getHandle() |
com.sun.jna.ptr.IntByReference |
getJnaHandle() |
int |
getNetworkTimeout()
Gets the current network timeout for this attachment.
|
byte[] |
getServiceInfo(ServiceParameterBuffer serviceParameterBuffer,
ServiceRequestBuffer serviceRequestBuffer,
int maxBufferLength)
Performs a service info request (service query.
|
protected void |
internalDetach()
Actual implementation of service detach.
|
void |
processStatusVector(ISC_STATUS[] statusVector,
WarningMessageCallback warningMessageCallback) |
void |
setNetworkTimeout(int milliseconds)
Sets the network timeout for this attachment.
|
void |
startServiceAction(ServiceRequestBuffer serviceRequestBuffer)
Starts a service action.
|
addServiceListener, close, getDescribeServiceRequestBuffer, getServiceInfo, getServiceInformationProcessor, getServiceWarningCallback, removeServiceListeneraddExceptionListener, forceClose, getDatatypeCoder, getEncoding, getEncodingFactory, getServerVersion, getServerVersionInformation, getSynchronizationObject, isAttached, removeExceptionListener, safelyDetach, setAttached, setDetached, setServerVersionclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, forceClose, getDatatypeCoder, getEncoding, getEncodingFactory, getServerVersion, getSynchronizationObject, isAttachedaddExceptionListener, removeExceptionListenerpublic static final int STATUS_VECTOR_SIZE
public JnaService(JnaServiceConnection connection)
public ServiceParameterBuffer createServiceParameterBuffer()
FbServiceServiceParameterBuffer.
Attach expects a service parameter buffer to have the version as the first item. This needs to be added explicitly.
createServiceParameterBuffer in interface FbServicepublic ServiceRequestBuffer createServiceRequestBuffer()
createServiceRequestBuffer in interface FbServiceprotected void checkConnected()
throws java.sql.SQLException
AbstractFbAttachmentSQLException if it isn't connected.checkConnected in class AbstractFbAttachment<JnaServiceConnection>java.sql.SQLExceptionpublic byte[] getServiceInfo(ServiceParameterBuffer serviceParameterBuffer, ServiceRequestBuffer serviceRequestBuffer, int maxBufferLength) throws java.sql.SQLException
FbServicegetServiceInfo in interface FbServiceserviceParameterBuffer - Service parameters (can be null)serviceRequestBuffer - Service request infomaxBufferLength - Maximum response buffer length to usemaxBufferLengthjava.sql.SQLException - For errors retrieving the information.public void startServiceAction(ServiceRequestBuffer serviceRequestBuffer) throws java.sql.SQLException
FbServicestartServiceAction in interface FbServiceserviceRequestBuffer - Service action request detailsjava.sql.SQLException - For errors starting the service action.public void attach()
throws java.sql.SQLException
FbAttachmentattach in interface FbAttachmentjava.sql.SQLExceptionprotected void afterAttachActions()
throws java.sql.SQLException
Implementation retrieves service information like server version.
java.sql.SQLException - For errors reading or writing database information.protected void internalDetach()
throws java.sql.SQLException
AbstractFbService
Implementations of this method should only be called from AbstractFbService.close(), and should not
notify service listeners of the service ServiceListener.detaching(FbService) and
ServiceListener.detached(FbService) events.
internalDetach in class AbstractFbService<JnaServiceConnection>java.sql.SQLExceptionpublic int getHandle()
getHandle in interface FbAttachmentgetHandle in interface FbServicepublic com.sun.jna.ptr.IntByReference getJnaHandle()
public void setNetworkTimeout(int milliseconds)
throws java.sql.SQLException
FbAttachmentsetNetworkTimeout in interface FbAttachmentmilliseconds - Timeout in milliseconds; 0 means no timeout. If the attachment doesn't support milliseconds, it should
round up to the nearest second.java.sql.SQLException - If this attachment is closed, the value of milliseconds is smaller than 0, or if setting the
timeout fails.java.sql.SQLFeatureNotSupportedException - If this attachment doesn't support (changing) the network timeout.public int getNetworkTimeout()
throws java.sql.SQLException
FbAttachmentgetNetworkTimeout in interface FbAttachmentgetNetworkTimeout in class AbstractFbAttachment<JnaServiceConnection>java.sql.SQLException - If this attachment is closedjava.sql.SQLFeatureNotSupportedException - If this attachment doesn't support network timeoutpublic void processStatusVector(ISC_STATUS[] statusVector, WarningMessageCallback warningMessageCallback) throws java.sql.SQLException
java.sql.SQLExceptionprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.ThrowableCopyright © 2001-2022 Jaybird (Firebird JDBC/JCA) team. All rights reserved.