Full list of JDBC Provider Configuration Keys

Version 1.1 by christoph_lechleitner@iteg_at on 2013-07-09 04.05:41

Introduction

In most usecases, only the required configuration keys of DataSources will be used: url, username, password, validationQuery.

The following chapter provides a full list of supported key name patterns.

Ful list of org.clazzes.jdbc.provider datasource configuration keys

The JDBC-Provider supplies applications with Instances of org.apache.commons.dbcp.BasicDataSource from Apache's commons-dbcp project, therefore most values go right into it's setters.

Key

Description

Ac. BasicDataSource setter

accessToUnderlyingConnectionAllowed

Should not matter. Changes have no effect after pool initialization.

connectionInitSqls

List of SQL Statements to be executed when a physical connection is first created. Comma separated. Changes have no effect after pool initialization.

connectionProperties

Connection properties.

defaultAutoCommit

Default autocommit state. Should not matter for well-designed applications. Changes have no effect after pool initialization.

defaultCatalog

Default catalog name. Changes have no effect after pool initialization.

defaultReadOnly

Changes have no effect after pool initialization.

defaultTransactionIsolation

Changes have no effect after pool initialization.

datasource.<datasourcename>.driverClassName

Optional for common database backends. Name of the database driver to use.

For MySQL, MSSQL, PostgreSQL and Oracle the driver class name is automatically deduced from the JDBC URL.

The class is resolved using the class loader of the jdbc-provider bundle.
This allows for putting JDBC driver on the boot classloader of the OSGi container or creating fragment bundles, which supply JDBC drivers to the jdbc-provider bundle.

initialSize

Initial size of the pool. Changes have no effect after pool initialization.

maxActive

Maximum number of active connections that can be allocated at the same time. Use a negative value for no limit.

maxIdle

Maximum number of connections that can remain idle in the pool.

maxOpenPreparedStatement

Maximum number of PreparedStatements to pool. Use a negative value for no limit. Changes have no effect after pool initialization.

maxWait

Use a negative value for no limit.

minEvictableIdleTimeMillis

Minimum amount of time an object may sit idle in the pool.

minIdle

Minimum number of idle connections in the pool.

datasource.<datasourcename>.password

Required. JDBC Password. Changes have no effect after pool initialization.

poolPreparedStatements

Whether to pool statements or not. Changes have no effect after pool initialization.

removeAbandoned

-

removeAbandonedTimeout

-

testOnBorrow

Wether the validation query shall be executed before each "borrow" from the pool.

testOnReturn

Wether the validation query shall be executed when a connection is returned to the pool.

testWhileIdle

Wether the validation query shall be executed regularily to keep the connection alive.

timeBetweenEvictionRunsMillis

-

datasource.<datasourcename>.url

Required. JDBC URL. JDBC URL examples for common databases can be found in our JDBC Snippets. Changes have no effect after pool initialization.

datasource.<datasourcename>.username

Required. JDBC User. Changes have no effect after pool initialization.

datasource.<datasourcename>.validationQuery

Required. Validation query, executed to ensure the application receives a valid connection.
Common validation queries can be found in our JDBC Snippets.

For more supported key patterns take a look at the JavaDoc of the org.clazzes.util.jdbc.provider.JdbcProvider class.

Typical JDBC URLs and validation queries can be found in our JDBC Snippets.