Class AbstractFbAttachment<T extends AbstractConnection<? extends IAttachProperties<?>,​? extends FbAttachment>>

    • Constructor Detail

      • AbstractFbAttachment

        protected AbstractFbAttachment​(T connection,
                                       DatatypeCoder datatypeCoder)
    • Method Detail

      • forceClose

        public void forceClose()
                        throws java.sql.SQLException
        Forces the connection to close without proper detach or cleanup.

        If a given implementation does not support this, then this method should call FbAttachment.close().

        Default implementation, calls FbAttachment.close()

        Specified by:
        forceClose in interface FbAttachment
        Throws:
        java.sql.SQLException - For problems closing the connection.
      • setServerVersion

        protected final void setServerVersion​(java.lang.String... versionStrings)
        Sets the Firebird version from one or more version string elements.

        This method should only be called by this instance.

        Parameters:
        versionStrings - Raw version strings
      • getServerVersionInformation

        protected org.firebirdsql.gds.ng.ServerVersionInformation getServerVersionInformation()
      • setAttached

        protected final void setAttached()
        Called when this attachment is attached.

        Only this AbstractFbDatabase instance should call this method.

      • isAttached

        public boolean isAttached()
        Description copied from interface: FbAttachment
        Current attachment status.
        Specified by:
        isAttached in interface FbAttachment
        Returns:
        true if connected to the server and attached to a database or service, false otherwise.
      • setDetached

        protected final void setDetached()
        Called when this attachment is detached.

        Only this AbstractFbAttachment instance should call this method.

      • getSynchronizationObject

        public final java.lang.Object getSynchronizationObject()
        Description copied from interface: FbAttachment
        Get synchronization object.
        Specified by:
        getSynchronizationObject in interface FbAttachment
        Returns:
        object, cannot be null.
      • getNetworkTimeout

        public int getNetworkTimeout()
                              throws java.sql.SQLException
        Description copied from interface: FbAttachment
        Gets the current network timeout for this attachment.
        Specified by:
        getNetworkTimeout in interface FbAttachment
        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
      • checkConnected

        protected abstract void checkConnected()
                                        throws java.sql.SQLException
        Checks if the attachment is connected, and throws a SQLException if it isn't connected.
        Throws:
        java.sql.SQLException
      • safelyDetach

        protected final void safelyDetach()
        Performs FbAttachment.close() suppressing any exception.