## org.firebirdsql.pool
Interface FirebirdPool

All Superinterfaces:
  ConnectionPoolConfiguration, FirebirdConnectionProperties

All Known Implementing Classes:
  AbstractFBConnectionPoolDataSource, FBConnectionPoolDataSource, FBWrappingDataSource, FBWrappingDataSource

    public interface FirebirdPool

extends FirebirdConnectionProperties, ConnectionPoolConfiguration

Configuration for the `FBWrappingDataSource` and `FBConnectionPoolDataSource` objects. Following properties are supported:

- `blobBufferSize` size of the buffer used to transfer BLOB data.
- `blockingTimeout` time in milliseconds during which `DataSource.getConnection()` method will block if no free connection is in pool.
- `charSet` similar to `encoding`, but takes Java character set name instead of Firebird's encoding.
- `database` path to a database including the server name; for example `localhost/3050:c:/path/to/database.gdb`.
- `encoding` character encoding for the JDBC connection.
- `freeSize` read-only: gives amount of free connections in the pool, when 0, blocking will occur if `workingSize` is equal to `maxPoolSize`.
- `isolation` default transaction isolation level for connections as string; possible values are:
  - TRANSACTION_READ_COMMITTED
  - TRANSACTION_REPEATABLE_READ
  - TRANSACTION_SERIALIZABLE
- `loginTimeout` property from `DataSource`, in this context is a synonym for `blockingTimeout` (however value is specified in seconds).
- `maxIdleTime` time in milliseconds after which idle physical connection in the pool is closed.
- `maxStatements` maximum number of pooled prepared statements, if 0, pooling is switched off.
- `maxPoolSize` maximum number of physical connections that can be opened by this data source.
- `minPoolSize` minimum number of connections that will remain open by this data source.
- `nonStandardProperty` a non-standard connection parameter in form `name[=value]`.
- `password` password that is used to connect to database.
- `pingInterval` time interval during which connection will be proved for aliveness.
- `pooling` allows switching pooling off.
- `statementPooling` alternative way to switch statement pooling off.
- `socketBufferSize` size of the socket buffer in bytes. In some cases values used by JVM by default are not optimal. This results in performance degradation (especially when you transfer big BLOBs). Usually 8192 bytes provides good results.
- `roleName` SQL role name.
- `tpbMapping` mapping of the TPB parameters to JDBC transaction isolation levels.
- `transactionIsolationLevel` default transaction isolation level, number from `Connection` interface.
- `totalSize` total number of allocated connections.
- `type` type of connection that will be created. There are four possible types: pure Java (or type 4), type 2 that will use Firebird client library to connect to the database, local-mode type 2 driver, and embedded that will use embedded engine (access to local databases). Possible values are (case insensitive):
  - `"PURE_JAVA"` or `"TYPE4"` for pure Java (type 4) JDBC connections;
  - `"NATIVE"` or `"TYPE2"` to use Firebird client library;
  - `"LOCAL"` to use Firebird client library in local-mode (IPC link to server);
  - `"EMBEDDED"` to use embedded engine.
- `userName` name of the user that will be used to access the database.
- `workingSize` number of connections that are in use (e.g. were obtained using `DataSource.getConnection()` method, but not yet closed).

Author:
  Roman Rokytskyy

Method Summary
`int` `getBlockingTimeout()` Get time during which `ConnectionPoolDataSource.getPooledConnection()` can block.
`int` `getFreeSize()`
`int` `getMaxIdleTime()` Get time after which idle connections will be deallocated.
`int` `getMaxPoolSize()` Get maximum number of physical connections that can be simultaneously open.
`int` `getMaxStatements()`
`int` `getMinPoolSize()` Get minimum number of open JDBC connections that will be created when pool is started.
`int` `getPingInterval()` Get time interval after which connection should be pinged.
`int` `getTotalSize()`
`int` `getWorkingSize()`
`boolean` `isPooling()` Check if this connection pool uses connection pooling, or just implements JDBC 2.0 SE interfaces.
`boolean` `isStatementPooling()` Check if this connection pool provides also prepared statement pooling.
`void` `restart()`
`void` `setBlockingTimeout(int blockingTimeoutValue)`
`void` `setMaxIdleTime(int maxIdleTime)`
`void` `setMaxPoolSize(int maxPoolSize)`
`void` `setMaxStatements(int maxStatements)`
`void` `setMinPoolSize(int minPoolSize)`
`void` `setPingInterval(int pingIntervalValue)`
`void` `setPooling(boolean pooling)`
`void` `setStatementPooling(boolean statementPooling)`
`void` `shutdown()`

Methods inherited from interface org.firebirdsql.jdbc.FirebirdConnectionProperties

`getBlobBufferSize, getBuffersNumber, getCharSet, getDatabase, getDatabaseParameterBuffer, getDefaultIsolation, getDefaultTransactionIsolation, getEncoding, getNonStandardProperty, getPassword, getRoleName, getSocketBufferSize, getSqlDialect, getTpbMapping, getTransactionParameters, getType, getUserName, getUseTranslation, isDefaultResultSetHoldable, isTimestampUsesLocalTimezone, isUseStandardUdf, isUseStreamBlobs, setBlobBufferSize, setBuffersNumber, setCharSet, setDatabase, setDefaultIsolation, setDefaultResultSetHoldable, setDefaultTransactionIsolation, setEncoding, setNonStandardProperty, setNonStandardProperty, setPassword, setRoleName, setSocketBufferSize, setSqlDialect, setTimestampUsesLocalTimezone, setTpbMapping, setTransactionParameters, setType, setUserName, setUseStandardUdf, setUseStreamBlobs, setUseTranslation`

Methods inherited from interface org.firebirdsql.pool.ConnectionPoolConfiguration
`getIdleTimeout, getMaxConnections, getMinConnections, getPingStatement, getRetryInterval, isPingable`

Method Detail

### restart

    void restart()

### shutdown

    void shutdown()

### getBlockingTimeout

    int getBlockingTimeout()

  Description copied from interface: `ConnectionPoolConfiguration`
  Get time during which `ConnectionPoolDataSource.getPooledConnection()` can block. By default method blocks forever.

  Specified by:
    `getBlockingTimeout` in interface `ConnectionPoolConfiguration`
  Returns:
    pool blocking timeout in milliseconds, `Integer.MAX_VALUE` indicates blocking forever.

### setBlockingTimeout

    void setBlockingTimeout(int blockingTimeoutValue)

### getMaxIdleTime

    int getMaxIdleTime()

  Description copied from interface: `ConnectionPoolConfiguration`
  Get time after which idle connections will be deallocated.

  Specified by:
    `getMaxIdleTime` in interface `ConnectionPoolConfiguration`
  Returns:
    idle timeout in milliseconds, `Integer.MAX_VALUE` indicates that idle connections are not removed.

### setMaxIdleTime

    void setMaxIdleTime(int maxIdleTime)

### getMaxStatements

    int getMaxStatements()

### setMaxStatements

    void setMaxStatements(int maxStatements)

### getMaxPoolSize

    int getMaxPoolSize()

  Description copied from interface: `ConnectionPoolConfiguration`
  Get maximum number of physical connections that can be simultaneously open.

  Specified by:
    `getMaxPoolSize` in interface `ConnectionPoolConfiguration`
  Returns:
    maximum number of simultaneously open physical database connections, 0 if no limit exists.

### setMaxPoolSize

    void setMaxPoolSize(int maxPoolSize)

### getMinPoolSize

    int getMinPoolSize()

  Description copied from interface: `ConnectionPoolConfiguration`
  Get minimum number of open JDBC connections that will be created when pool is started.

  Specified by:
    `getMinPoolSize` in interface `ConnectionPoolConfiguration`
  Returns:
    minimum number of open JDBC connections to open at startup.

### setMinPoolSize

    void setMinPoolSize(int minPoolSize)

### getPingInterval

    int getPingInterval()

  Description copied from interface: `ConnectionPoolConfiguration`
  Get time interval after which connection should be pinged.

  Specified by:
    `getPingInterval` in interface `ConnectionPoolConfiguration`
  Returns:
    number of milliseconds in the ping interval.

### setPingInterval

    void setPingInterval(int pingIntervalValue)

### isPooling

    boolean isPooling()

  Description copied from interface: `ConnectionPoolConfiguration`
  Check if this connection pool uses connection pooling, or just implements JDBC 2.0 SE interfaces. By default pooling is on. It might make sense to set pooling off to check performance degradation in test environment. It could be also used in the environment where physical connection must be closed right after usage, however using JDBC 2.0 SE interfaces is either a requirement or is simpler than standard `java.sql.Driver`.

  Specified by:
    `isPooling` in interface `ConnectionPoolConfiguration`
  Returns:
    `true` if pooling is enabled.

### setPooling

    void setPooling(boolean pooling)

### isStatementPooling

    boolean isStatementPooling()

  Description copied from interface: `ConnectionPoolConfiguration`
  Check if this connection pool provides also prepared statement pooling. By default prepared statement pooling is enabled, however there might be situations where statement pooling is not desired, for example in environments where database can quickly run out of handles and fast handle reuse is required.

  Specified by:
    `isStatementPooling` in interface `ConnectionPoolConfiguration`
  Returns:
    `true` if prepared statement pooling is enabled.

### setStatementPooling

    void setStatementPooling(boolean statementPooling)

### getFreeSize

    int getFreeSize()
                    throws SQLException

  Throws:
    `SQLException`

### getWorkingSize

    int getWorkingSize()
                       throws SQLException

  Throws:
    `SQLException`

### getTotalSize

    int getTotalSize()
                     throws SQLException

  Throws:
    `SQLException`

Copyright © 2001-2010. All Rights Reserved.