In most usecases, only the required configuration keys of DataSources will be used:
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.
|Ac. BasicDataSource setter|
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.||setConnectionInitSqls(Collection)|
|defaultAutoCommit||Default autocommit state. Should not matter for well-designed applications. Changes have no effect after pool initialization.||setDefaultAutoCommit(boolean)|
|defaultCatalog||Default catalog name. Changes have no effect after pool initialization.||setDefaultCatalog(String)|
Changes have no effect after pool initialization.
|defaultTransactionIsolation||Changes have no effect after pool initialization.||setDefaultTransactionIsolation(int)|
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.
|initialSize||Initial size of the pool. Changes have no effect after pool initialization.||setInitialSize(int)|
|maxActive||Maximum number of active connections that can be allocated at the same time. Use a negative value for no limit.||setMaxActive(int)|
|maxIdle||Maximum number of connections that can remain idle in the pool.||setMaxIdle(int)|
|maxOpenPreparedStatement||Maximum number of PreparedStatements to pool. Use a negative value for no limit. Changes have no effect after pool initialization.||setMaxOpenPreparedStatements(int)|
|maxWait||Use a negative value for no limit.||setMaxWait(long)|
|minEvictableIdleTimeMillis||Minimum amount of time an object may sit idle in the pool.||setMinEvictableIdleTimeMillis(long)|
|minIdle||Minimum number of idle connections in the pool.||setMinIdle(int)|
|Required. JDBC Password. Changes have no effect after pool initialization.||setPassword(String)|
|poolPreparedStatements||Whether to pool statements or not. Changes have no effect after pool initialization.||setPoolPreparedStatements(boolean)|
|testOnBorrow||Wether the validation query shall be executed before each "borrow" from the pool.||setTestOnBorrow(boolean)|
|testOnReturn||Wether the validation query shall be executed when a connection is returned to the pool.||setTestOnReturn(boolean)|
|testWhileIdle||Wether the validation query shall be executed regularily to keep the connection alive.||setTestWhileIdle(boolean)|
|Required. JDBC URL. JDBC URL examples for common databases can be found in our JDBC Snippets. Changes have no effect after pool initialization.||setUrl(String)|
|Required. JDBC User. Changes have no effect after pool initialization.||setUsername(String)|
|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.