public abstract class AbstractFbAttachment<T extends AbstractConnection<? extends IAttachProperties<?>,? extends FbAttachment>> extends java.lang.Object implements FbAttachment
AbstractFbService and AbstractFbDatabase.| Modifier and Type | Field and Description |
|---|---|
protected T |
connection |
protected ExceptionListenerDispatcher |
exceptionListenerDispatcher |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractFbAttachment(T connection,
DatatypeCoder datatypeCoder) |
| Modifier and Type | Method and Description |
|---|---|
void |
addExceptionListener(ExceptionListener listener)
Adds an exception listener to this object.
|
protected abstract void |
checkConnected()
Checks if the attachment is connected, and throws a
SQLException if it isn't connected. |
void |
forceClose()
Forces the connection to close without proper detach or cleanup.
|
DatatypeCoder |
getDatatypeCoder() |
Encoding |
getEncoding() |
IEncodingFactory |
getEncodingFactory() |
int |
getNetworkTimeout()
Gets the current network timeout for this attachment.
|
GDSServerVersion |
getServerVersion() |
protected org.firebirdsql.gds.ng.ServerVersionInformation |
getServerVersionInformation() |
java.lang.Object |
getSynchronizationObject()
Get synchronization object.
|
boolean |
isAttached()
Current attachment status.
|
void |
removeExceptionListener(ExceptionListener listener)
Removes an exception listener to this object.
|
protected void |
safelyDetach()
Performs
FbAttachment.close() suppressing any exception. |
protected void |
setAttached()
Called when this attachment is attached.
|
protected void |
setDetached()
Called when this attachment is detached.
|
protected void |
setServerVersion(java.lang.String... versionStrings)
Sets the Firebird version from one or more version string elements.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitattach, close, getHandle, setNetworkTimeoutprotected final ExceptionListenerDispatcher exceptionListenerDispatcher
protected final T extends AbstractConnection<? extends IAttachProperties<?>,? extends FbAttachment> connection
protected AbstractFbAttachment(T connection, DatatypeCoder datatypeCoder)
public void forceClose()
throws java.sql.SQLException
If a given implementation does not support this, then this method should call FbAttachment.close().
Default implementation, calls FbAttachment.close()
forceClose in interface FbAttachmentjava.sql.SQLException - For problems closing the connection.public GDSServerVersion getServerVersion()
getServerVersion in interface FbAttachmentprotected final void setServerVersion(java.lang.String... versionStrings)
This method should only be called by this instance.
versionStrings - Raw version stringsprotected org.firebirdsql.gds.ng.ServerVersionInformation getServerVersionInformation()
protected final void setAttached()
Only this AbstractFbDatabase instance should call this method.
public boolean isAttached()
FbAttachmentisAttached in interface FbAttachmenttrue if connected to the server and attached to a database or service, false
otherwise.protected final void setDetached()
Only this AbstractFbAttachment instance should call this method.
public final java.lang.Object getSynchronizationObject()
FbAttachmentgetSynchronizationObject in interface FbAttachmentnull.public final IEncodingFactory getEncodingFactory()
getEncodingFactory in interface FbAttachmentIEncodingFactory for this connectionpublic final Encoding getEncoding()
getEncoding in interface FbAttachmentIEncodingFactory.getDefaultEncoding() on the result of FbAttachment.getEncodingFactory().public final DatatypeCoder getDatatypeCoder()
getDatatypeCoder in interface FbAttachmentDatatypeCoder for this database implementation.public int getNetworkTimeout()
throws java.sql.SQLException
FbAttachmentgetNetworkTimeout in interface FbAttachmentjava.sql.SQLException - If this attachment is closedjava.sql.SQLFeatureNotSupportedException - If this attachment doesn't support network timeoutpublic final void addExceptionListener(ExceptionListener listener)
ExceptionListenable
Implementations use WeakReference.
addExceptionListener in interface ExceptionListenablelistener - Listener to registerpublic final void removeExceptionListener(ExceptionListener listener)
ExceptionListenableremoveExceptionListener in interface ExceptionListenablelistener - Listener to removeprotected abstract void checkConnected()
throws java.sql.SQLException
SQLException if it isn't connected.java.sql.SQLExceptionprotected final void safelyDetach()
FbAttachment.close() suppressing any exception.Copyright © 2001-2022 Jaybird (Firebird JDBC/JCA) team. All rights reserved.