Package org.firebirdsql.gds.ng
Interface FbAttachment
- 
- All Superinterfaces:
- java.lang.AutoCloseable,- ExceptionListenable
 - All Known Subinterfaces:
- FbDatabase,- FbService,- FbWireAttachment,- FbWireDatabase,- FbWireService,- JnaAttachment
 - All Known Implementing Classes:
- AbstractFbAttachment,- AbstractFbDatabase,- AbstractFbService,- AbstractFbWireDatabase,- AbstractFbWireService,- JnaDatabase,- JnaService,- V10Database,- V10Service,- V11Database,- V12Database,- V13Database,- V15Database,- V16Database
 
 public interface FbAttachment extends java.lang.AutoCloseable, ExceptionListenable Connection to a Firebird server (to a database or service).All methods defined in this interface and the direct descendants FbDatabaseandFbServiceare required to notify allSQLExceptionthrown from the methods defined in this interface, and those exceptions notified by allExceptionListenableimplementations created from them.- Since:
- 3.0
- Author:
- Mark Rotteveel
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidattach()Attach to the attachment type.voidclose()Detaches and closes the connection.voidforceClose()Forces the connection to close without proper detach or cleanup.DatatypeCodergetDatatypeCoder()EncodinggetEncoding()IEncodingFactorygetEncodingFactory()intgetHandle()intgetNetworkTimeout()Gets the current network timeout for this attachment.GDSServerVersiongetServerVersion()java.lang.ObjectgetSynchronizationObject()Get synchronization object.booleanisAttached()Current attachment status.voidsetNetworkTimeout(int milliseconds)Sets the network timeout for this attachment.- 
Methods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenableaddExceptionListener, removeExceptionListener
 
- 
 
- 
- 
- 
Method Detail- 
attachvoid attach() throws java.sql.SQLExceptionAttach to the attachment type.- Throws:
- java.sql.SQLException
 
 - 
closevoid close() throws java.sql.SQLExceptionDetaches and closes the connection.- Specified by:
- closein interface- java.lang.AutoCloseable
- Throws:
- java.sql.SQLException- If not currently connected, or another problem occurred detaching.
 
 - 
forceClosevoid forceClose() throws java.sql.SQLExceptionForces the connection to close without proper detach or cleanup.If a given implementation does not support this, then this method should call close().- Throws:
- java.sql.SQLException- For problems closing the connection.
 
 - 
getHandleint getHandle() - Returns:
- The attachment handle value
 
 - 
getServerVersionGDSServerVersion getServerVersion() - Returns:
- Firebird version string
 
 - 
isAttachedboolean isAttached() Current attachment status.- Returns:
- trueif connected to the server and attached to a database or service,- falseotherwise.
 
 - 
getSynchronizationObjectjava.lang.Object getSynchronizationObject() Get synchronization object.- Returns:
- object, cannot be null.
 
 - 
getEncodingFactoryIEncodingFactory getEncodingFactory() - Returns:
- The IEncodingFactoryfor this connection
 
 - 
getEncodingEncoding getEncoding() - Returns:
- The connection encoding (should be the same as returned from calling
 IEncodingFactory.getDefaultEncoding()on the result ofgetEncodingFactory().
 
 - 
getDatatypeCoderDatatypeCoder getDatatypeCoder() - Returns:
- The DatatypeCoderfor this database implementation.
 
 - 
setNetworkTimeoutvoid setNetworkTimeout(int milliseconds) throws java.sql.SQLExceptionSets the network timeout for this attachment.- Parameters:
- milliseconds- Timeout in milliseconds; 0 means no timeout. If the attachment doesn't support milliseconds, it should round up to the nearest second.
- Throws:
- java.sql.SQLException- If this attachment is closed, the value of- millisecondsis smaller than 0, or if setting the timeout fails.
- java.sql.SQLFeatureNotSupportedException- If this attachment doesn't support (changing) the network timeout.
 
 - 
getNetworkTimeoutint getNetworkTimeout() throws java.sql.SQLExceptionGets the current network timeout for this attachment.- Returns:
- Timeout in milliseconds, 0 means no timeout
- Throws:
- java.sql.SQLException- If this attachment is closed
- java.sql.SQLFeatureNotSupportedException- If this attachment doesn't support network timeout
 
 
- 
 
-