org.firebirdsql.gds.impl

## Class GDSHelper

- java.lang.Object
- - org.firebirdsql.gds.impl.GDSHelper

- All Implemented Interfaces:
    Synchronizable

      public final class GDSHelper
      extends java.lang.Object
      implements Synchronizable

  Helper class for all GDS-related operations.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_BLOB_BUFFER_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GDSHelper(FbDatabase database)` Create instance of this class.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `FbStatement` | `allocateStatement()` Retrieve a newly allocated statement handle with the current connection.
    `void` | `cancelOperation()` Cancel the currently running operation.
    `int` | `compareToVersion(int major, int minor)` Compares the version of this database to the specified major and minor version.
    `FbBlob` | `createBlob(boolean segmented)` Create a new blob within the current transaction.
    `void` | `detachDatabase()`
    `void` | `executeImmediate(java.lang.String statement)` Execute a SQL statement directly with the current connection.
    `int` | `getBlobBufferLength()` Get the buffer length for blobs for this connection.
    `IConnectionProperties` | `getConnectionProperties()`
    `FbDatabase` | `getCurrentDatabase()`
    `FbTransaction` | `getCurrentTransaction()`
    `DatabaseParameterBuffer` | `getDatabaseParameterBuffer()`
    `int` | `getDatabaseProductMajorVersion()` Get the major version number of the database that we're connected to.
    `int` | `getDatabaseProductMinorVersion()` Get the minor version number of the database that we're connected to.
    `java.lang.String` | `getDatabaseProductName()` Get the name of the database product that we're connected to.
    `java.lang.String` | `getDatabaseProductVersion()` Get the version of the the database that we're connected to
    `int` | `getDialect()`
    `java.lang.String` | `getIscEncoding()` Get the encoding used for this connection.
    `java.lang.String` | `getJavaEncoding()`
    `java.lang.String` | `getMappingPath()`
    `java.lang.Object` | `getSynchronizationObject()` Get synchronization object.
    `java.lang.String` | `getUserName()` Get the database login name of the user that we're connected as.
    `boolean` | `inTransaction()` Retrieve whether this connection is currently involved in a transaction
    `int` | `iscVaxInteger(byte[] buffer, int pos, int length)` Deprecated. Use `VaxEncoding.iscVaxInteger(byte[], int, int)`. This method will be removed in Jaybird 4
    `long` | `iscVaxLong(byte[] buffer, int pos, int length)` Deprecated. Use `VaxEncoding.iscVaxLong(byte[], int, int)`. This method will be removed in Jaybird 4
    `FbBlob` | `openBlob(long blob_id, boolean segmented)` Open a handle to a new blob within the current transaction with the given id.
    `void` | `setCurrentTransaction(FbTransaction transaction)`
    `FbTransaction` | `startTransaction(TransactionParameterBuffer tpb)`

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

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

- - ### Field Detail

    - #### DEFAULT_BLOB_BUFFER_SIZE

          public static final int DEFAULT_BLOB_BUFFER_SIZE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### GDSHelper

          public GDSHelper(FbDatabase database)

      Create instance of this class.

  - ### Method Detail

    - #### getCurrentTransaction

          public FbTransaction getCurrentTransaction()

    - #### setCurrentTransaction

          public void setCurrentTransaction(FbTransaction transaction)

    - #### getCurrentDatabase

          public FbDatabase getCurrentDatabase()

    - #### getConnectionProperties

          public IConnectionProperties getConnectionProperties()

    - #### getDatabaseParameterBuffer

          public DatabaseParameterBuffer getDatabaseParameterBuffer()

    - #### getDialect

          public int getDialect()

      Returns:
        Connection dialect

    - #### allocateStatement

          public FbStatement allocateStatement()
                                        throws java.sql.SQLException

      Retrieve a newly allocated statement handle with the current connection.
      Returns:
        The new statement handle
      Throws:
        `java.sql.SQLException` - if a database access error occurs

    - #### inTransaction

          public boolean inTransaction()

      Retrieve whether this connection is currently involved in a transaction
      Returns:
        `true` if this connection is currently in a transaction, `false` otherwise.

    - #### executeImmediate

          public void executeImmediate(java.lang.String statement)
                                throws java.sql.SQLException

      Execute a SQL statement directly with the current connection.
      Parameters:
        `statement` - The SQL statement to execute
      Throws:
        `java.sql.SQLException` - if a Firebird-specific error occurs

    - #### openBlob

          public FbBlob openBlob(long blob_id,
                        boolean segmented)
                          throws java.sql.SQLException

      Open a handle to a new blob within the current transaction with the given id.
      Parameters:
        `blob_id` - The identifier to be given to the blob
        `segmented` - If `true`, the blob will be segmented, otherwise is will be streamed
      Throws:
        `java.sql.SQLException` - if a Firebird-specific database error occurs

    - #### createBlob

          public FbBlob createBlob(boolean segmented)
                            throws java.sql.SQLException

      Create a new blob within the current transaction.
      Parameters:
        `segmented` - If `true` the blob will be segmented, otherwise it will be streamed
      Throws:
        `java.sql.SQLException` - if a Firebird-specific database error occurs

    - #### startTransaction

          public FbTransaction startTransaction(TransactionParameterBuffer tpb)
                                         throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### detachDatabase

          public void detachDatabase()
                              throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### cancelOperation

          public void cancelOperation()
                               throws java.sql.SQLException

      Cancel the currently running operation.
      Throws:
        `java.sql.SQLException`

    - #### iscVaxInteger

          @Deprecated
          public int iscVaxInteger(byte[] buffer,
                                     int pos,
                                     int length)

      Deprecated. Use `VaxEncoding.iscVaxInteger(byte[], int, int)`. This method will be removed in Jaybird 4

    - #### iscVaxLong

          @Deprecated
          public long iscVaxLong(byte[] buffer,
                                   int pos,
                                   int length)

      Deprecated. Use `VaxEncoding.iscVaxLong(byte[], int, int)`. This method will be removed in Jaybird 4

    - #### getDatabaseProductName

          public java.lang.String getDatabaseProductName()

      Get the name of the database product that we're connected to.
      Returns:
        The database product name (i.e. Firebird or Interbase)

    - #### getDatabaseProductVersion

          public java.lang.String getDatabaseProductVersion()

      Get the version of the the database that we're connected to
      Returns:
        the database product version

    - #### getDatabaseProductMajorVersion

          public int getDatabaseProductMajorVersion()

      Get the major version number of the database that we're connected to.
      Returns:
        The major version number of the database

    - #### getDatabaseProductMinorVersion

          public int getDatabaseProductMinorVersion()

      Get the minor version number of the database that we're connected to.
      Returns:
        The minor version number of the database

    - #### compareToVersion

          public int compareToVersion(int major,
                             int minor)

      Compares the version of this database to the specified major and minor version.

      This method follows the semantics of `Comparable`: returns a negative value if the version of this database connection is smaller than the supplied arguments, 0 if they are equal or positive if its bigger.

      Parameters:
        `major` - Major version to compare
        `minor` - Minor version to compare
      Returns:
        a negative integer, zero, or a positive integer as this database version is less than, equal to, or greater than the specified major and minor version

    - #### getUserName

          public java.lang.String getUserName()

      Get the database login name of the user that we're connected as.
      Returns:
        The username of the current database user

    - #### getBlobBufferLength

          public int getBlobBufferLength()

      Get the buffer length for blobs for this connection.
      Returns:
        The length of blob buffers

    - #### getIscEncoding

          public java.lang.String getIscEncoding()

      Get the encoding used for this connection.
      Returns:
        The name of the encoding used

    - #### getJavaEncoding

          public java.lang.String getJavaEncoding()

    - #### getMappingPath

          public java.lang.String getMappingPath()

    - #### getSynchronizationObject

          public java.lang.Object getSynchronizationObject()

      Description copied from interface: `Synchronizable`
      Get synchronization object.
      Specified by:
        `getSynchronizationObject` in interface `Synchronizable`
      Returns:
        object, cannot be `null`.

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