Class AbstractFbWireService

    • Constructor Detail

      • AbstractFbWireService

        protected AbstractFbWireService​(WireServiceConnection connection,
                                        ProtocolDescriptor descriptor)
        Creates an AbstractFbWireDatabase instance.
        Parameters:
        connection - A WireConnection with an established connection to the server.
        descriptor - The ProtocolDescriptor that created this connection (this is used for creating further dependent objects).
    • Method Detail

      • checkConnected

        protected final void checkConnected()
                                     throws java.sql.SQLException
        Checks if a physical connection to the server is established.
        Specified by:
        checkConnected in class AbstractFbAttachment<WireServiceConnection>
        Throws:
        java.sql.SQLException - If not connected.
      • checkAttached

        protected final void checkAttached()
                                    throws java.sql.SQLException
        Checks if a physical connection to the server is established and if the connection is attached to a database.

        This method calls checkConnected(), so it is not necessary to call both.

        Throws:
        java.sql.SQLException - If the database not connected or attached.
      • setNetworkTimeout

        public void setNetworkTimeout​(int milliseconds)
                               throws java.sql.SQLException
        Description copied from interface: FbAttachment
        Sets the network timeout for this attachment.
        Specified by:
        setNetworkTimeout in interface FbAttachment
        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 milliseconds is smaller than 0, or if setting the timeout fails.
        java.sql.SQLFeatureNotSupportedException - If this attachment doesn't support (changing) the network timeout.
      • getXdrIn

        protected final XdrInputStream getXdrIn()
                                         throws java.sql.SQLException
        Gets the XdrInputStream.
        Returns:
        Instance of XdrInputStream
        Throws:
        java.sql.SQLException - If no connection is opened or when exceptions occur retrieving the InputStream
      • getXdrOut

        protected final XdrOutputStream getXdrOut()
                                           throws java.sql.SQLException
        Gets the XdrOutputStream.
        Returns:
        Instance of XdrOutputStream
        Throws:
        java.sql.SQLException - If no connection is opened or when exceptions occur retrieving the OutputStream
      • readGenericResponse

        public final GenericResponse readGenericResponse​(WarningMessageCallback warningCallback)
                                                  throws java.sql.SQLException,
                                                         java.io.IOException
        Description copied from interface: FbWireAttachment
        Convenience method to read a Response to a GenericResponse
        Specified by:
        readGenericResponse in interface FbWireAttachment
        Parameters:
        warningCallback - Callback object for warnings, null for default callback
        Returns:
        GenericResponse
        Throws:
        java.sql.SQLException - For errors returned from the server, or when attempting to read.
        java.io.IOException - For errors reading the response from the connection.
      • closeConnection

        protected final void closeConnection()
                                      throws java.io.IOException
        Closes the WireConnection associated with this connection.
        Throws:
        java.io.IOException - For errors closing the connection.
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable