Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Firebird Open Source J2ee connector - jdbc driver
   *
   * Distributable under LGPL license.
   * You may obtain a copy of the License at http://www.gnu.org/copyleft/lgpl.html
   *
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * LGPL License for more details.
  *
  * This file was created by members of the firebird development team.
  * All individual contributions remain the Copyright (C) of those
  * individuals.  Contributors to this file are either listed here or
  * can be obtained from a CVS history command.
  *
  * All rights reserved.
  */
 
 package org.firebirdsql.pool;

This interface describes a configuration for AbstractConnectionPool instances. Motivation for separating pool configuration into interface is quite simple, it allows third-party applications to load configuration from various sources (resource bundle, XML file, etc.).

Author(s):
Roman Rokytskyy
 
 public interface ConnectionPoolConfiguration {

Get minimum number of open JDBC connections that will be created when pool is started.

Deprecated:
please use getMinPoolSize() instead.
Returns:
minimum number of open JDBC connections to open at startup.
 
 	int getMinConnections();
    
    
Get minimum number of open JDBC connections that will be created when pool is started.

Returns:
minimum number of open JDBC connections to open at startup.
 
     int getMinPoolSize();

Get maximum number of physical connections that can be simultaneously open.

Deprecated:
please use getMaxPoolSize() instead.
Returns:
maximum number of simultaneously open physical database connections, 0 if no limit exists.
 
 	int getMaxConnections();
    
    
Get maximum number of physical connections that can be simultaneously open.

Returns:
maximum number of simultaneously open physical database connections, 0 if no limit exists.
 
     int getMaxPoolSize();
    
    
Get time during which javax.sql.ConnectionPoolDataSource.getPooledConnection() can block. By default method blocks forever.

Returns:
pool blocking timeout in milliseconds, java.lang.Integer.MAX_VALUE indicates blocking forever.
 
     int getBlockingTimeout();

    
Get interval of getting connections retries. It might happen that pool contains no free connection. In order not to wait until connection is returned into the pool, pool will try to obtain connection again and again with the interval returned by this method. Default value is 1000 (1 sec).

Returns:
retry interval in milliseconds.
     
     int getRetryInterval();
    
    
Get time after which idle connections will be deallocated.

Deprecated:
please use getMaxIdleTime() instead.
Returns:
idle timeout in milliseconds, java.lang.Integer.MAX_VALUE indicates that idle connections are not removed.
 
     int getIdleTimeout();

    
Get time after which idle connections will be deallocated.

Returns:
idle timeout in milliseconds, java.lang.Integer.MAX_VALUE indicates that idle connections are not removed.
    int getMaxIdleTime();
    
    
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.

Returns:
true if pooling is enabled.
    boolean isPooling();
    
    
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.

Returns:
true if prepared statement pooling is enabled.
    boolean isStatementPooling();
    
Check if this pool supports pingable connections. Pingable connections are used to correctly check if connection is still alive or not.

Returns:
true if this pool supports pingable connections.
	boolean isPingable();

Get SQL statement that will be used to ping connection. Ping SQL statement returns exactly one row without throwing an exception. Ping SQL statement must not influence the outcome of a transaction.

Examples of ping SQL statements:

  • Oracle: "SELECT CAST(1 AS INTEGER) FROM DUAL"
  • Firebird: "SELECT CAST(1 AS INTEGER) FROM RDB$DATABASE"

Returns:
SQL statement that will be used to ping connection.
Get time interval after which connection should be pinged.

Returns:
number of milliseconds in the ping interval.
New to GrepCode? Check out our FAQ X