All Implemented Interfaces:
AutoCloseable, FbStatement, ExceptionListenable, FbWireStatement
Direct Known Subclasses:
V12Statement

public class V11Statement extends V10Statement
FbWireStatement implementation for the version 11 wire protocol.
Since:
3.0
Author:
Mark Rotteveel
  • Field Details

  • Constructor Details

    • V11Statement

      public V11Statement(FbWireDatabase database)
      Creates a new instance of V11Statement for the specified database.
      Parameters:
      database - FbWireDatabase implementation
  • Method Details

    • prepare

      public void prepare(String statementText) throws SQLException
      Description copied from interface: FbStatement
      Prepare the statement text.

      If this handle is in state StatementState.NEW then it will first allocate the statement.

      Specified by:
      prepare in interface FbStatement
      Overrides:
      prepare in class V10Statement
      Parameters:
      statementText - Statement text
      Throws:
      SQLException - If a database access error occurs, or this statement is currently executing a query.
    • fetchRows

      public void fetchRows(int fetchSize) throws SQLException
      Description copied from interface: FbStatement
      Requests this statement to fetch the next fetchSize rows.

      Fetched rows are not returned from this method, but sent to the registered StatementListener instances.

      If an asynchronous fetch is pending, that pending fetch should be completed instead of performing a new fetch.

      Specified by:
      fetchRows in interface FbStatement
      Overrides:
      fetchRows in class V10Statement
      Parameters:
      fetchSize - Number of rows to fetch (must be greater than 0)
      Throws:
      SQLException - For database access errors, when called on a closed statement, when no cursor is open or when the fetch size is not greater than 0
      See Also:
    • asyncFetchRows

      public final void asyncFetchRows(int fetchSize) throws SQLException
      Description copied from interface: FbStatement
      Requests the server to perform an asynchronous fetch for fetch size.

      Asynchronous fetching is an optional feature. If an implementation does not support asynchronous fetching, it should return immediately and do nothing. Although this interface provides a default implementation which does nothing, implementations should override it, to throw an exception when called on a closed statement.

      For implementations which do support async fetching, this call should not do anything if one of the following is true:

      • an asynchronous fetch is already pending
      • fetchSize is 1 or the statement has a cursor name set
      • the current statement has a scrollable cursor (flag CURSOR_TYPE_SCROLLABLE set)
      • the connection property asyncFetch is false

      An asynchronous fetch can be completed explicitly by calling FbStatement.fetchRows(int), or implicitly by other network operations.

      Specified by:
      asyncFetchRows in interface FbStatement
      Overrides:
      asyncFetchRows in class AbstractFbStatement
      Parameters:
      fetchSize - number of rows to fetch (must be greater than 0)
      Throws:
      SQLException - for database access errors, when called on a closed statement, when no cursor is open or when the fetch size is not greater than 0
      See Also:
    • completeAsyncFetch

      protected boolean completeAsyncFetch() throws SQLException
      Completes a pending async fetch.
      Returns:
      true if a pending async fetch was processed, false if there was no pending async fetch.
      Throws:
      SQLException - from unsuccessfully completed async fetch, or for errors try to complete deferred actions
      Since:
      6
    • free

      protected void free(int option) throws SQLException
      Description copied from class: AbstractFbStatement
      Frees the currently allocated statement. Either close the cursor with ISCConstants.DSQL_close or drop the statement handle using ISCConstants.DSQL_drop.
      Overrides:
      free in class V10Statement
      Parameters:
      option - Free option
      Throws:
      SQLException
    • reset

      protected void reset(boolean resetAll)
      Description copied from class: AbstractFbStatement
      Resets the statement for next execution. Implementation in derived class must lock on FbStatement.withLock() and call super.reset(resetAll)
      Overrides:
      reset in class AbstractFbStatement
      Parameters:
      resetAll - Also reset field and parameter info