Top Description Constructors Methods
com.mchange.v2.c3p0

public final Class PoolBackedDataSourceFactory

extends Object
Class Inheritance
Imports
java.sql.SQLException, javax.sql.DataSource, com.mchange.v2.sql.SqlUtils

Deprecated

Use the new factories in com.mchange.v2.c3p0.DataSources. See examples.

A class offering Factory methods for creating DataSources backed by Connection and Statement Pools.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static DataSource
create(DataSource
an unpooledDataSource to use as the primary source for connections.
unpooledDataSource
,
int
the minimum (and starting) number of Connections that should be held in the pool.
minPoolSize
,
int
the maximum number of Connections that should be held in the pool.
maxPoolSize
,
int
the number of Connections that should be acquired at a time when the pool runs out of Connections
acquireIncrement
,
int
the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.
maxIdleTime
,
int
the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.
maxStatements
,
String
a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally. Used only if the JNDI service prefers References to Serialized Objects when Objects are bound.
factoryLocation
)

Creates a pool-backed DataSource using unpooledDataSource as its source for Connections.

public static DataSource
create(DataSource
an unpooledDataSource to use as the primary source for connections.
unpooledDataSource
,
int
the minimum (and starting) number of Connections that should be held in the pool.
minPoolSize
,
int
the maximum number of Connections that should be held in the pool.
maxPoolSize
,
int
the number of Connections that should be acquired at a time when the pool runs out of Connections
acquireIncrement
,
int
the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.
maxIdleTime
,
int
the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.
maxStatements
)

Creates a pool-backed DataSource using unpooledDataSource as its source for Connections.

public static DataSource
create(DataSource
an unpooledDataSource to use as the primary source for connections.
unpooledDataSource
)

Creates a pool-backed DataSource using unpooledDataSource as its source for Connections and default values for pool params.

public static DataSource
create(String
a jdbc driver class that can resolve jdbcUrl.
jdbcDriverClass
,
String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
String
a username (may be null) for authentication to the RDBMS
user
,
String
a password (may be null) for authentication to the RDBMS
password
,
int
the minimum (and starting) number of Connections that should be held in the pool.
minPoolSize
,
int
the maximum number of Connections that should be held in the pool.
maxPoolSize
,
int
the number of Connections that should be acquired at a time when the pool runs out of Connections
acquireIncrement
,
int
the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.
maxIdleTime
,
int
the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.
maxStatements
,
String
a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally. Used only if the JNDI service prefers References to Serialized Objects when Objects are bound.
factoryLocation
)

Creates a pool-backed DataSource.

public static DataSource
create(String
a jdbc driver class that can resolve jdbcUrl.
jdbcDriverClass
,
String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
String
a username (may be null) for authentication to the RDBMS
user
,
String
a password (may be null) for authentication to the RDBMS
password
,
int
the minimum (and starting) number of Connections that should be held in the pool.
minPoolSize
,
int
the maximum number of Connections that should be held in the pool.
maxPoolSize
,
int
the number of Connections that should be acquired at a time when the pool runs out of Connections
acquireIncrement
,
int
the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.
maxIdleTime
,
int
the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.
maxStatements
)

Creates a pool-backed DataSource.

public static DataSource
create(String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
String
a username (may be null) for authentication to the RDBMS
user
,
String
a password (may be null) for authentication to the RDBMS
password
,
int
the minimum (and starting) number of Connections that should be held in the pool.
minPoolSize
,
int
the maximum number of Connections that should be held in the pool.
maxPoolSize
,
int
the number of Connections that should be acquired at a time when the pool runs out of Connections
acquireIncrement
,
int
the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.
maxIdleTime
,
int
the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.
maxStatements
,
String
a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally. Used only if the JNDI service prefers References to Serialized Objects when Objects are bound.
factoryLocation
)

Creates a pool-backed DataSource.

public static DataSource
create(String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
String
a username (may be null) for authentication to the RDBMS
user
,
String
a password (may be null) for authentication to the RDBMS
password
,
int
the minimum (and starting) number of Connections that should be held in the pool.
minPoolSize
,
int
the maximum number of Connections that should be held in the pool.
maxPoolSize
,
int
the number of Connections that should be acquired at a time when the pool runs out of Connections
acquireIncrement
,
int
the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.
maxIdleTime
,
int
the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.
maxStatements
)

Creates a pool-backed DataSource.

public static DataSource
create(String
a jdbc driver class that can resolve jdbcUrl.
jdbcDriverClass
,
String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
String
a username (may be null) for authentication to the RDBMS
user
,
String
a password (may be null) for authentication to the RDBMS
password
)

Creates a pool-backed DataSource using default values for pool parameters.

public static DataSource
create(String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
String
a username (may be null) for authentication to the RDBMS
user
,
String
a password (may be null) for authentication to the RDBMS
password
)

Creates a pool-backed DataSource using default pool parameters.

public static DataSource
createReferenceable(DataSource
an unpooledDataSource to use as the primary source for connections.
unpooledDataSource
,
int
the minimum (and starting) number of Connections that should be held in the pool.
minPoolSize
,
int
the maximum number of Connections that should be held in the pool.
maxPoolSize
,
int
the number of Connections that should be acquired at a time when the pool runs out of Connections
acquireIncrement
,
int
the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.
maxIdleTime
,
int
the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.
maxStatements
,
String
a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally.
factoryLocation
)
Deprecated all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that implements Referenceable for binding to JNDI name services.

public static DataSource
createReferenceable(DataSource
an unpooledDataSource to use as the primary source for connections.
unpooledDataSource
,
String
a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally.
factoryLocation
)
Deprecated all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that uses default pool parameters and implements Referenceable for binding to JNDI name services.

public static DataSource
createReferenceable(String
a jdbc driver class that can resolve jdbcUrl.
jdbcDriverClass
,
String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
String
a username (may be null) for authentication to the RDBMS
user
,
String
a password (may be null) for authentication to the RDBMS
password
,
int
the minimum (and starting) number of Connections that should be held in the pool.
minPoolSize
,
int
the maximum number of Connections that should be held in the pool.
maxPoolSize
,
int
the number of Connections that should be acquired at a time when the pool runs out of Connections
acquireIncrement
,
int
the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.
maxIdleTime
,
int
the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.
maxStatements
,
String
a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally.
factoryLocation
)
Deprecated all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that implements Referenceable.

public static DataSource
createReferenceable(String
a jdbc driver class that can resolve jdbcUrl.
jdbcDriverClass
,
String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
String
a username (may be null) for authentication to the RDBMS
user
,
String
a password (may be null) for authentication to the RDBMS
password
,
String
a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally.
factoryLocation
)
Deprecated all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that implements Referenceable and uses default pooling parameters.

public static DataSource
createSerializable(DataSource
an unpooledDataSource to use as the primary source for connections.
unpooledDataSource
,
int
the minimum (and starting) number of Connections that should be held in the pool.
minPoolSize
,
int
the maximum number of Connections that should be held in the pool.
maxPoolSize
,
int
the number of Connections that should be acquired at a time when the pool runs out of Connections
acquireIncrement
,
int
the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.
maxIdleTime
,
int
the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.
maxStatements
)
Deprecated all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that implements Serializable for binding to JNDI name services.

public static DataSource
createSerializable(DataSource
an unpooledDataSource to use as the primary source for connections.
unpooledDataSource
)
Deprecated all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that uses default pool parameters and implements Serializable for binding to JNDI name services.

public static DataSource
createSerializable(String
a jdbc driver class that can resolve jdbcUrl.
jdbcDriverClass
,
String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
String
a username (may be null) for authentication to the RDBMS
user
,
String
a password (may be null) for authentication to the RDBMS
password
,
int
the minimum (and starting) number of Connections that should be held in the pool.
minPoolSize
,
int
the maximum number of Connections that should be held in the pool.
maxPoolSize
,
int
the number of Connections that should be acquired at a time when the pool runs out of Connections
acquireIncrement
,
int
the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.
maxIdleTime
,
int
the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.
maxStatements
)
Deprecated all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that implements Serializable.

public static DataSource
createSerializable(String
a jdbc driver class that can resolve jdbcUrl.
jdbcDriverClass
,
String
the jdbcUrl of the RDBMS that Connections should be made to.
jdbcUrl
,
String
a username (may be null) for authentication to the RDBMS
user
,
String
a password (may be null) for authentication to the RDBMS
password
)
Deprecated all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that implements Serializable and uses default pooling parameters.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PoolBackedDataSourceFactoryback to summary
private PoolBackedDataSourceFactory()

Method Detail

createback to summary
public static DataSource create(DataSource unpooledDataSource, int minPoolSize, int maxPoolSize, int acquireIncrement, int maxIdleTime, int maxStatements, String factoryLocation) throws SQLException

Creates a pool-backed DataSource using unpooledDataSource as its source for Connections. Not necessarily suitable for JNDI binding.

Parameters
unpooledDataSource:DataSource

an unpooledDataSource to use as the primary source for connections.

minPoolSize:int

the minimum (and starting) number of Connections that should be held in the pool.

maxPoolSize:int

the maximum number of Connections that should be held in the pool.

acquireIncrement:int

the number of Connections that should be acquired at a time when the pool runs out of Connections

maxIdleTime:int

the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.

maxStatements:int

the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.

factoryLocation:String

a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally. Used only if the JNDI service prefers References to Serialized Objects when Objects are bound.

createback to summary
public static DataSource create(DataSource unpooledDataSource, int minPoolSize, int maxPoolSize, int acquireIncrement, int maxIdleTime, int maxStatements) throws SQLException

Creates a pool-backed DataSource using unpooledDataSource as its source for Connections. Not necessarily suitable for JNDI binding.

Parameters
unpooledDataSource:DataSource

an unpooledDataSource to use as the primary source for connections.

minPoolSize:int

the minimum (and starting) number of Connections that should be held in the pool.

maxPoolSize:int

the maximum number of Connections that should be held in the pool.

acquireIncrement:int

the number of Connections that should be acquired at a time when the pool runs out of Connections

maxIdleTime:int

the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.

maxStatements:int

the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.

createback to summary
public static DataSource create(DataSource unpooledDataSource) throws SQLException

Creates a pool-backed DataSource using unpooledDataSource as its source for Connections and default values for pool params.

Parameters
unpooledDataSource:DataSource

an unpooledDataSource to use as the primary source for connections.

createback to summary
public static DataSource create(String jdbcDriverClass, String jdbcUrl, String user, String password, int minPoolSize, int maxPoolSize, int acquireIncrement, int maxIdleTime, int maxStatements, String factoryLocation) throws SQLException

Creates a pool-backed DataSource.

Parameters
jdbcDriverClass:String

a jdbc driver class that can resolve jdbcUrl.

jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

user:String

a username (may be null) for authentication to the RDBMS

password:String

a password (may be null) for authentication to the RDBMS

minPoolSize:int

the minimum (and starting) number of Connections that should be held in the pool.

maxPoolSize:int

the maximum number of Connections that should be held in the pool.

acquireIncrement:int

the number of Connections that should be acquired at a time when the pool runs out of Connections

maxIdleTime:int

the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.

maxStatements:int

the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.

factoryLocation:String

a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally. Used only if the JNDI service prefers References to Serialized Objects when Objects are bound.

createback to summary
public static DataSource create(String jdbcDriverClass, String jdbcUrl, String user, String password, int minPoolSize, int maxPoolSize, int acquireIncrement, int maxIdleTime, int maxStatements) throws SQLException

Creates a pool-backed DataSource.

Parameters
jdbcDriverClass:String

a jdbc driver class that can resolve jdbcUrl.

jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

user:String

a username (may be null) for authentication to the RDBMS

password:String

a password (may be null) for authentication to the RDBMS

minPoolSize:int

the minimum (and starting) number of Connections that should be held in the pool.

maxPoolSize:int

the maximum number of Connections that should be held in the pool.

acquireIncrement:int

the number of Connections that should be acquired at a time when the pool runs out of Connections

maxIdleTime:int

the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.

maxStatements:int

the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.

createback to summary
public static DataSource create(String jdbcUrl, String user, String password, int minPoolSize, int maxPoolSize, int acquireIncrement, int maxIdleTime, int maxStatements, String factoryLocation) throws SQLException

Creates a pool-backed DataSource.

Warning

If you use this method, you must make sure a JDBC driver capable of resolving jdbcUrl has been preloaded!

Parameters
jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

user:String

a username (may be null) for authentication to the RDBMS

password:String

a password (may be null) for authentication to the RDBMS

minPoolSize:int

the minimum (and starting) number of Connections that should be held in the pool.

maxPoolSize:int

the maximum number of Connections that should be held in the pool.

acquireIncrement:int

the number of Connections that should be acquired at a time when the pool runs out of Connections

maxIdleTime:int

the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.

maxStatements:int

the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.

factoryLocation:String

a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally. Used only if the JNDI service prefers References to Serialized Objects when Objects are bound.

createback to summary
public static DataSource create(String jdbcUrl, String user, String password, int minPoolSize, int maxPoolSize, int acquireIncrement, int maxIdleTime, int maxStatements) throws SQLException

Creates a pool-backed DataSource.

Warning

If you use this method, you must make sure a JDBC driver capable of resolving jdbcUrl has been preloaded!

Parameters
jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

user:String

a username (may be null) for authentication to the RDBMS

password:String

a password (may be null) for authentication to the RDBMS

minPoolSize:int

the minimum (and starting) number of Connections that should be held in the pool.

maxPoolSize:int

the maximum number of Connections that should be held in the pool.

acquireIncrement:int

the number of Connections that should be acquired at a time when the pool runs out of Connections

maxIdleTime:int

the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.

maxStatements:int

the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.

createback to summary
public static DataSource create(String jdbcDriverClass, String jdbcUrl, String user, String password) throws SQLException

Creates a pool-backed DataSource using default values for pool parameters. Not necessarily suitable for JNDI binding.

Parameters
jdbcDriverClass:String

a jdbc driver class that can resolve jdbcUrl.

jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

user:String

a username (may be null) for authentication to the RDBMS

password:String

a password (may be null) for authentication to the RDBMS

createback to summary
public static DataSource create(String jdbcUrl, String user, String password) throws SQLException

Creates a pool-backed DataSource using default pool parameters.

Warning

If you use this method, you must make sure a JDBC driver capable of resolving jdbcUrl has been preloaded!

Parameters
jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

user:String

a username (may be null) for authentication to the RDBMS

password:String

a password (may be null) for authentication to the RDBMS

createReferenceableback to summary
public static DataSource createReferenceable(DataSource unpooledDataSource, int minPoolSize, int maxPoolSize, int acquireIncrement, int maxIdleTime, int maxStatements, String factoryLocation) throws SQLException

Deprecated

all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that implements Referenceable for binding to JNDI name services. For this to work, unpooledDataSource must also implement Referenceable.

Parameters
unpooledDataSource:DataSource

an unpooledDataSource to use as the primary source for connections.

minPoolSize:int

the minimum (and starting) number of Connections that should be held in the pool.

maxPoolSize:int

the maximum number of Connections that should be held in the pool.

acquireIncrement:int

the number of Connections that should be acquired at a time when the pool runs out of Connections

maxIdleTime:int

the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.

maxStatements:int

the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.

factoryLocation:String

a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally.

createReferenceableback to summary
public static DataSource createReferenceable(DataSource unpooledDataSource, String factoryLocation) throws SQLException

Deprecated

all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that uses default pool parameters and implements Referenceable for binding to JNDI name services. For this to work, unpooledDataSource must also implement Referenceable.

Parameters
unpooledDataSource:DataSource

an unpooledDataSource to use as the primary source for connections.

factoryLocation:String

a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally.

createReferenceableback to summary
public static DataSource createReferenceable(String jdbcDriverClass, String jdbcUrl, String user, String password, int minPoolSize, int maxPoolSize, int acquireIncrement, int maxIdleTime, int maxStatements, String factoryLocation) throws SQLException

Deprecated

all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that implements Referenceable.

Parameters
jdbcDriverClass:String

a jdbc driver class that can resolve jdbcUrl.

jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

user:String

a username (may be null) for authentication to the RDBMS

password:String

a password (may be null) for authentication to the RDBMS

minPoolSize:int

the minimum (and starting) number of Connections that should be held in the pool.

maxPoolSize:int

the maximum number of Connections that should be held in the pool.

acquireIncrement:int

the number of Connections that should be acquired at a time when the pool runs out of Connections

maxIdleTime:int

the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.

maxStatements:int

the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.

factoryLocation:String

a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally.

createReferenceableback to summary
public static DataSource createReferenceable(String jdbcDriverClass, String jdbcUrl, String user, String password, String factoryLocation) throws SQLException

Deprecated

all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that implements Referenceable and uses default pooling parameters.

Parameters
jdbcDriverClass:String

a jdbc driver class that can resolve jdbcUrl.

jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

user:String

a username (may be null) for authentication to the RDBMS

password:String

a password (may be null) for authentication to the RDBMS

factoryLocation:String

a codebase url where JNDI clients can find the c3p0 libraries. Use null if clients will be expected to have the libraries available locally.

createSerializableback to summary
public static DataSource createSerializable(DataSource unpooledDataSource, int minPoolSize, int maxPoolSize, int acquireIncrement, int maxIdleTime, int maxStatements) throws SQLException

Deprecated

all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that implements Serializable for binding to JNDI name services. For this to work, unpooledDataSource must also implement Serializable.

Parameters
unpooledDataSource:DataSource

an unpooledDataSource to use as the primary source for connections.

minPoolSize:int

the minimum (and starting) number of Connections that should be held in the pool.

maxPoolSize:int

the maximum number of Connections that should be held in the pool.

acquireIncrement:int

the number of Connections that should be acquired at a time when the pool runs out of Connections

maxIdleTime:int

the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.

maxStatements:int

the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.

createSerializableback to summary
public static DataSource createSerializable(DataSource unpooledDataSource) throws SQLException

Deprecated

all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that uses default pool parameters and implements Serializable for binding to JNDI name services. For this to work, unpooledDataSource must also implement Serializable.

Parameters
unpooledDataSource:DataSource

an unpooledDataSource to use as the primary source for connections.

createSerializableback to summary
public static DataSource createSerializable(String jdbcDriverClass, String jdbcUrl, String user, String password, int minPoolSize, int maxPoolSize, int acquireIncrement, int maxIdleTime, int maxStatements) throws SQLException

Deprecated

all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that implements Serializable.

Parameters
jdbcDriverClass:String

a jdbc driver class that can resolve jdbcUrl.

jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

user:String

a username (may be null) for authentication to the RDBMS

password:String

a password (may be null) for authentication to the RDBMS

minPoolSize:int

the minimum (and starting) number of Connections that should be held in the pool.

maxPoolSize:int

the maximum number of Connections that should be held in the pool.

acquireIncrement:int

the number of Connections that should be acquired at a time when the pool runs out of Connections

maxIdleTime:int

the maximum number of seconds a Connection should be allowed to remain idle before it is expired from the pool. A value of 0 means Connections never expire.

maxStatements:int

the maximum number of PreparedStatements that should be cached by this pool. A value of 0 means that Statement caching should be disabled.

createSerializableback to summary
public static DataSource createSerializable(String jdbcDriverClass, String jdbcUrl, String user, String password) throws SQLException

Deprecated

all implementations are now both Referenceable and Serializable. use create()

Creates a pool-backed DataSource that implements Serializable and uses default pooling parameters.

Parameters
jdbcDriverClass:String

a jdbc driver class that can resolve jdbcUrl.

jdbcUrl:String

the jdbcUrl of the RDBMS that Connections should be made to.

user:String

a username (may be null) for authentication to the RDBMS

password:String

a password (may be null) for authentication to the RDBMS