org.firebirdsql.gds.ng

## Interface IConnectionProperties

- All Superinterfaces:
    IAttachProperties<IConnectionProperties>
  All Known Implementing Classes:
    FbConnectionProperties, FbImmutableConnectionProperties

      public interface IConnectionProperties
      extends IAttachProperties<IConnectionProperties>

  Connection properties for the Firebird connection.

  TODO Remove overlap/duplication with `FirebirdConnectionProperties`

  Since:
    3.0
  Author:
    Mark Rotteveel

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_BUFFERS_NUMBER`
    `static short` | `DEFAULT_DIALECT`

    - ### Fields inherited from interface org.firebirdsql.gds.ng.IAttachProperties

      `DEFAULT_CONNECT_TIMEOUT, DEFAULT_PORT, DEFAULT_SERVER_NAME, DEFAULT_SO_TIMEOUT, DEFAULT_SOCKET_BUFFER_SIZE`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `IConnectionProperties` | `asImmutable()`
    `IConnectionProperties` | `asNewMutable()`
    `short` | `getConnectionDialect()` Get the dialect of the client connection
    `java.lang.String` | `getDatabaseName()`
    `DatabaseParameterBuffer` | `getExtraDatabaseParameters()` Gets the extra database parameters.
    `int` | `getPageCacheSize()` Get the page cache size.
    `boolean` | `isColumnLabelForName()` Gets the current setting of `columnLabelForName`
    `boolean` | `isResultSetDefaultHoldable()` Get whether ResultSets are holdable by default.
    `void` | `setColumnLabelForName(boolean columnLabelForName)` Set if `ResultSetMetaData.getColumnName(int)` returns the `columnLabel` instead of the `columnName`.
    `void` | `setConnectionDialect(short connectionDialect)` Set the dialect of the client connection
    `void` | `setDatabaseName(java.lang.String databaseName)`
    `void` | `setPageCacheSize(int pageCacheSize)` Set the page cache size.
    `void` | `setResultSetDefaultHoldable(boolean holdable)` Set if `ResultSet` should be `ResultSet.HOLD_CURSORS_OVER_COMMIT` by default.

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

      `getAttachObjectName, getCharSet, getConnectTimeout, getDbCryptConfig, getEncoding, getPassword, getPortNumber, getRoleName, getServerName, getSocketBufferSize, getSoTimeout, getUser, getWireCrypt, setCharSet, setConnectTimeout, setDbCryptConfig, setEncoding, setPassword, setPortNumber, setRoleName, setServerName, setSocketBufferSize, setSoTimeout, setUser, setWireCrypt`

- - ### Field Detail

    - #### DEFAULT_DIALECT

          static final short DEFAULT_DIALECT

      See Also:
        Constant Field Values

    - #### DEFAULT_BUFFERS_NUMBER

          static final int DEFAULT_BUFFERS_NUMBER

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getDatabaseName

          java.lang.String getDatabaseName()

      Returns:
        Name or alias of the database

    - #### setDatabaseName

          void setDatabaseName(java.lang.String databaseName)

      Parameters:
        `databaseName` - Name or alias of the database

    - #### getConnectionDialect

          short getConnectionDialect()

      Get the dialect of the client connection

      NOTE: Implementer should take care to return `DEFAULT_DIALECT` if the value hasn't been set yet.

      Returns:
        SQL dialect of the client.

    - #### setConnectionDialect

          void setConnectionDialect(short connectionDialect)

      Set the dialect of the client connection

      NOTE: Implementer should take care to use `DEFAULT_DIALECT` if the value hasn't been set yet.

      Parameters:
        `connectionDialect` - SQL dialect of the client.

    - #### getPageCacheSize

          int getPageCacheSize()

      Get the page cache size.

      A value of `0` indicates that the value is not set, and that the server default is used.

      This option is only relevant for Firebird implementations with per connection cache (eg Classic)

      NOTE: Implementer should take care to return `DEFAULT_BUFFERS_NUMBER` if the value hasn't been set yet.

      Returns:
        number of cache buffers that should be allocated for this connection, should be specified for ClassicServer instances, SuperServer has a server-wide configuration parameter.

    - #### setPageCacheSize

          void setPageCacheSize(int pageCacheSize)

      Set the page cache size.

      A value of `0` indicates that the value is not set, and that the server default is used.

      This option is only relevant for Firebird implementations with per connection cache (eg Classic)

      NOTE: Implementer should take care to use `DEFAULT_BUFFERS_NUMBER` if the value hasn't been set yet.

      Parameters:
        `pageCacheSize` - number of cache buffers that should be allocated for this connection, should be specified for ClassicServer instances, SuperServer has a server-wide configuration parameter.

    - #### setResultSetDefaultHoldable

          void setResultSetDefaultHoldable(boolean holdable)

      Set if `ResultSet` should be `ResultSet.HOLD_CURSORS_OVER_COMMIT` by default.
      Parameters:
        `holdable` - `true` ResultSets are holdable, `false` (default) ResultSets are `ResultSet.CLOSE_CURSORS_AT_COMMIT`

    - #### isResultSetDefaultHoldable

          boolean isResultSetDefaultHoldable()

      Get whether ResultSets are holdable by default.
      Returns:
        `true` ResultSets by default are `ResultSet.HOLD_CURSORS_OVER_COMMIT`, `false` (default), ResultSets are `ResultSet.CLOSE_CURSORS_AT_COMMIT`

    - #### setColumnLabelForName

          void setColumnLabelForName(boolean columnLabelForName)

      Set if `ResultSetMetaData.getColumnName(int)` returns the `columnLabel` instead of the `columnName`.

      The default behaviour (with `columnLabelForName=false` is JDBC-compliant. The behavior for value `true` is to provide compatibility with tools with a wrong expectation.

      Parameters:
        `columnLabelForName` - `false` JDBC compliant behavior (`columnName` is returned), `true` compatibility option (`columnLabel` is returned)

    - #### isColumnLabelForName

          boolean isColumnLabelForName()

      Gets the current setting of `columnLabelForName`
      Returns:
        `false` JDBC compliant behavior (`columnName` is returned), `true` compatibility option (`columnLabel` is returned)
      See Also:
        `setColumnLabelForName(boolean)`

    - #### getExtraDatabaseParameters

          DatabaseParameterBuffer getExtraDatabaseParameters()

      Gets the extra database parameters. This can be used to pass extra database parameters that are not directly supported.

      An immutable instance of `IConnectionProperties` must return a copy.

      Returns:
        DatabaseParameterBuffer instance.

    - #### asImmutable

          IConnectionProperties asImmutable()

      Specified by:
        `asImmutable` in interface `IAttachProperties<IConnectionProperties>`
      Returns:
        An immutable version of this instance as an implementation of `IConnectionProperties`

    - #### asNewMutable

          IConnectionProperties asNewMutable()

      Specified by:
        `asNewMutable` in interface `IAttachProperties<IConnectionProperties>`
      Returns:
        A new, mutable, instance as an implementation of `IConnectionProperties` with all properties copied.

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