org.firebirdsql.gds.ng.wire

## Class AbstractFbWireStatement

- java.lang.Object
- - org.firebirdsql.gds.ng.AbstractFbStatement
  - - org.firebirdsql.gds.ng.wire.AbstractFbWireStatement

- All Implemented Interfaces:
    FbStatement, ExceptionListenable, FbWireStatement
  Direct Known Subclasses:
    V10Statement

      public abstract class AbstractFbWireStatement
      extends AbstractFbStatement
      implements FbWireStatement

  Since:
    3.0
  Author:
    Mark Rotteveel

- - ### Field Summary

    - ### Fields inherited from class org.firebirdsql.gds.ng.AbstractFbStatement

      `exceptionListenerDispatcher, statementListenerDispatcher`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractFbWireStatement(FbWireDatabase database)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected byte[]` | `calculateBlr(RowDescriptor rowDescriptor)` Returns the (possibly cached) blr byte array for a `RowDescriptor`, or `null` if the parameter is null.
    `protected byte[]` | `calculateBlr(RowDescriptor rowDescriptor, RowValue rowValue)` Returns the blr byte array for a `RowValue`, or `null` if the parameter is null.
    `void` | `close()` Close and deallocate this statement.
    `RowDescriptor` | `emptyRowDescriptor()`
    `FbWireDatabase` | `getDatabase()`
    `int` | `getHandle()`
    `protected XdrInputStream` | `getXdrIn()` Gets the XdrInputStream.
    `protected XdrOutputStream` | `getXdrOut()` Gets the XdrOutputStream.
    `protected boolean` | `isValidTransactionClass(java.lang.Class<? extends FbTransaction> transactionClass)` Method to decide if a transaction implementation class is valid for the statement implementation.
    `protected void` | `setHandle(int handle)`

    - ### Methods inherited from class org.firebirdsql.gds.ng.AbstractFbStatement

      `addExceptionListener, addStatementListener, checkStatementValid, closeCursor, closeCursor, createExecutionPlanProcessor, createSqlCountProcessor, ensureClosedCursor, finalize, free, getExecutionPlan, getFieldDescriptor, getParameterDescriptionInfoRequestItems, getParameterDescriptor, getSqlCounts, getSqlInfo, getState, getStatementInfoRequestItems, getStatementWarningCallback, getSynchronizationObject, getTransaction, getTransactionListener, getType, hasFields, hasSingletonResult, isAllRowsFetched, isPrepareAllowed, parseStatementInfo, queueRowData, removeExceptionListener, removeStatementListener, reset, reset, resetAll, setAllRowsFetched, setFieldDescriptor, setParameterDescriptor, setTransaction, setType, switchState, validateParameters`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.firebirdsql.gds.ng.FbStatement

      `addStatementListener, closeCursor, closeCursor, ensureClosedCursor, execute, fetchRows, getDefaultSqlInfoSize, getExecutionPlan, getFieldDescriptor, getMaxSqlInfoSize, getParameterDescriptor, getSqlCounts, getSqlInfo, getSqlInfo, getState, getTransaction, getType, prepare, removeStatementListener, setCursorName, setTransaction`

    - ### Methods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenable

      `addExceptionListener, removeExceptionListener`

- - ### Constructor Detail

    - #### AbstractFbWireStatement

          public AbstractFbWireStatement(FbWireDatabase database)

  - ### Method Detail

    - #### 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

    - #### getDatabase

          public final FbWireDatabase getDatabase()

      Specified by:
        `getDatabase` in interface `FbStatement`
      Returns:
        The database connection that created this statement

    - #### getHandle

          public final int getHandle()

      Specified by:
        `getHandle` in interface `FbStatement`
      Returns:
        The Firebird statement handle identifier

    - #### setHandle

          protected final void setHandle(int handle)

    - #### calculateBlr

          protected final byte[] calculateBlr(RowDescriptor rowDescriptor)
                                       throws java.sql.SQLException

      Returns the (possibly cached) blr byte array for a `RowDescriptor`, or `null` if the parameter is null.
      Parameters:
        `rowDescriptor` - The row descriptor.
      Returns:
        blr byte array or `null` when `rowDescriptor` is `null`
      Throws:
        `java.sql.SQLException` - When the `RowDescriptor` contains an unsupported field type.

    - #### calculateBlr

          protected final byte[] calculateBlr(RowDescriptor rowDescriptor,
                            RowValue rowValue)
                                       throws java.sql.SQLException

      Returns the blr byte array for a `RowValue`, or `null` if the parameter is null.

      Contrary to `calculateBlr(org.firebirdsql.gds.ng.fields.RowDescriptor)`, it is not allowed to cache this value as it depends on the actual row value.

      Parameters:
        `rowValue` - The row value.
      Returns:
        blr byte array or `null` when `rowValue` is `null`
      Throws:
        `java.sql.SQLException` - When the `RowValue` contains an unsupported field type.

    - #### close

          public void close()
                     throws java.sql.SQLException

      Description copied from interface: `FbStatement`
      Close and deallocate this statement.
      Specified by:
        `close` in interface `FbStatement`
      Overrides:
        `close` in class `AbstractFbStatement`
      Throws:
        `java.sql.SQLException`

    - #### isValidTransactionClass

          protected boolean isValidTransactionClass(java.lang.Class<? extends FbTransaction> transactionClass)

      Description copied from class: `AbstractFbStatement`
      Method to decide if a transaction implementation class is valid for the statement implementation.

      Eg a `V10Statement` will only work with an `FbWireTransaction` implementation.

      Specified by:
        `isValidTransactionClass` in class `AbstractFbStatement`
      Parameters:
        `transactionClass` - Class of the transaction
      Returns:
        `true` when the transaction class is valid for the statement implementation.

    - #### emptyRowDescriptor

          public final RowDescriptor emptyRowDescriptor()

      Specified by:
        `emptyRowDescriptor` in interface `FbStatement`
      Returns:
        A potentially cached empty row descriptor for this statement or database.

Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.