Module org.firebirdsql.jaybird
Package org.firebirdsql.jdbc

# Interface FirebirdConnection

All Superinterfaces:
  `AutoCloseable`, `Connection`, `Wrapper`

All Known Implementing Classes:
  `FBConnection`

public interface FirebirdConnection extends Connection
Extension of `Connection` interface providing access to Firebird specific features.

Since:
  1.5
Author:
  Roman Rokytskyy

- ## Field Summary

  ### Fields inherited from interface java.sql.Connection

  `TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Blob`
  `createBlob()`
  `TransactionParameterBuffer`
  `createTransactionParameterBuffer()`
  Create new instance of `TransactionParameterBuffer`.
  `FbDatabase`
  `getFbDatabase()`
  Provides access to the low-level connection handle.
  `TransactionParameterBuffer`
  `getTransactionParameters(int isolationLevel)`
  Get transaction parameters for the specified transaction isolation level.
  `boolean`
  `isUseFirebirdAutoCommit()`
  `void`
  `resetKnownClientInfoProperties()`
  Resets the known client info properties of this connection to the defaults.
  `void`
  `setTransactionParameters(int isolationLevel, int[] parameters)`
  Deprecated.
  use `setTransactionParameters(int, TransactionParameterBuffer)` instead.
  `void`
  `setTransactionParameters(int isolationLevel, TransactionParameterBuffer tpb)`
  Set transaction parameters for the specified transaction isolation level.
  `void`
  `setTransactionParameters(TransactionParameterBuffer tpb)`
  Set transaction parameters for the next transactions.

  ### Methods inherited from interface java.sql.Connection

  `abort, beginRequest, clearWarnings, close, commit, createArrayOf, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, endRequest, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getNetworkTimeout, getSchema, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, isValid, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setNetworkTimeout, setReadOnly, setSavepoint, setSavepoint, setSchema, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid, setTransactionIsolation, setTypeMap`

  ### Methods inherited from interface java.sql.Wrapper

  `isWrapperFor, unwrap`

- ## Method Details

  - ### createBlob

    Blob createBlob() throws SQLException
    Specified by:
      `createBlob` in interface `Connection`
    Returns:
      instance of `FirebirdBlob`.
    Throws:
      `SQLException`

  - ### setTransactionParameters

    @Deprecated(since="2") void setTransactionParameters(int isolationLevel, int[] parameters) throws SQLException
    Deprecated.
    use `setTransactionParameters(int, TransactionParameterBuffer)` instead.
    Set transaction parameters for the specified isolation level. They will take effect only on the newly started transaction.
    Parameters:
      `isolationLevel` - JDBC isolation level.
      `parameters` - array of TPB parameters, see all TPB_* constants.
    Throws:
      `SQLException` - if specified transaction parameters cannot be set.

  - ### getTransactionParameters

    TransactionParameterBuffer getTransactionParameters(int isolationLevel) throws SQLException
    Get transaction parameters for the specified transaction isolation level.
    Parameters:
      `isolationLevel` - isolation level defined in the `Connection` interface.
    Returns:
      instance of `TransactionParameterBuffer` containing current transaction parameters.
    Throws:
      `SQLException` - if error occurred obtaining transaction parameters.
    Since:
      2

  - ### createTransactionParameterBuffer

    TransactionParameterBuffer createTransactionParameterBuffer() throws SQLException
    Create new instance of `TransactionParameterBuffer`.
    Returns:
      empty instance of `TransactionParameterBuffer`.
    Throws:
      `SQLException` - if error occurred during this operation.
    Since:
      2

  - ### setTransactionParameters

    void setTransactionParameters(int isolationLevel, TransactionParameterBuffer tpb) throws SQLException
    Set transaction parameters for the specified transaction isolation level.

    This method replaces the default TPB mapping with the specified one, changes will be effective from the next transaction start.

    Parameters:
      `tpb` - instance of `TransactionParameterBuffer` with parameters to set.
    Throws:
      `SQLException` - if error occurred during this operation.
    Since:
      2

  - ### setTransactionParameters

    void setTransactionParameters(TransactionParameterBuffer tpb) throws SQLException
    Set transaction parameters for the next transactions.

    This method does not change the TPB mapping, but replaces the mapping for the current transaction isolation until `Connection.setTransactionIsolation(int)` is called.

    This method cannot be called when a transaction is currently active.

    Parameters:
      `tpb` - instance of `TransactionParameterBuffer` with new transaction parameters.
    Throws:
      `SQLException` - if method is called within a transaction.
    Since:
      2

  - ### isUseFirebirdAutoCommit

    boolean isUseFirebirdAutoCommit()
    Returns:
      `true` if this connection is configured to use `isc_tpb_autocommit` when in auto commit.
    Since:
      3

  - ### getFbDatabase

    @InternalApi FbDatabase getFbDatabase() throws SQLException
    Provides access to the low-level connection handle.

    WARNING using this connection handle directly may bring the JDBC connection in an inconsistent state.

    Returns:
      The low-level connection handle.
    Throws:
      `SQLException`
    Since:
      3

  - ### resetKnownClientInfoProperties

    void resetKnownClientInfoProperties()
    Resets the known client info properties of this connection to the defaults. This does not reset the values of those properties on the server, but only resets the list of known properties held by this connection

    If this connection is closed, this is effectively a no-op. Primary use-case for this method is to reset a connection held in a connection pool.

    Since:
      6