A factory for pooled {@link ManagedDataSource}s.
Name | Default | Description |
{@code driverClass} | REQUIRED | The full name of the JDBC driver class. |
{@code url} | REQUIRED | The URL of the server. |
{@code user} | REQUIRED | The username used to connect to the server. |
{@code password} | none | The password used to connect to the server. |
{@code abandonWhenPercentageFull} | 0 | Connections that have been abandoned (timed out) won't get closed and reported up unless the number of connections in use are above the percentage defined by {@code abandonWhenPercentageFull}. The value should be between 0-100. |
{@code alternateUsernamesAllowed} | {@code false} | Set to true if the call {@link javax.sql.DataSource#getConnection(String,String) getConnection(username,password)}is allowed. This is used for when the pool is used by an application accessing multiple schemas. There is a performance impact turning this option on, even when not used. |
{@code commitOnReturn} | {@code false} | Set to true if you want the connection pool to commit any pending transaction when a connection is returned. |
{@code autoCommitByDefault} | JDBC driver's default | The default auto-commit state of the connections. |
{@code readOnlyByDefault} | JDBC driver's default | The default read-only state of the connections. |
{@code properties} | none | Any additional JDBC driver parameters. |
{@code defaultCatalog} | none | The default catalog to use for the connections. |
{@code defaultTransactionIsolation} | JDBC driver default | The default transaction isolation to use for the connections. Can be one of {@code none}, {@code default}, {@code read-uncommitted}, {@code read-committed}, {@code repeatable-read}, or {@code serializable}. |
{@code useFairQueue} | {@code true} | If {@code true}, calls to {@code getConnection} are handled in a FIFO manner. |
{@code initialSize} | 10 | The initial size of the connection pool. |
{@code minSize} | 10 | The minimum size of the connection pool. |
{@code maxSize} | 10 | The maximum size of the connection pool. |
{@code initializationQuery} | none | A custom query to be run when a connection is first created. |
{@code logAbandonedConnections} | {@code false} | If {@code true}, logs stack traces of abandoned connections. |
{@code logValidationErrors} | {@code false} | If {@code true}, logs errors when connections fail validation. |
{@code maxConnectionAge} | none | If set, connections which have been open for longer than {@code maxConnectionAge} areclosed when returned. |
{@code maxWaitForConnection} | 30 seconds | If a request for a connection is blocked for longer than this period, an exception will be thrown. |
{@code minIdleTime} | 1 minute | The minimum amount of time an connection must sit idle in the pool before it is eligible for eviction. |
{@code validationQuery} | {@code SELECT 1} | The SQL query that will be used to validate connections from this pool before returning them to the caller or pool. If specified, this query does not have to return any data, it just can't throw a SQLException. |
{@code validationQueryTimeout} | none | The timeout before a connection validation queries fail. |
{@code checkConnectionWhileIdle} | {@code true} | Set to true if query validation should take place while the connection is idle. |
{@code checkConnectionOnBorrow} | {@code false} | Whether or not connections will be validated before being borrowed from the pool. If the connection fails to validate, it will be dropped from the pool, and another will be borrowed. |
{@code checkConnectionOnConnect} | {@code false} | Whether or not connections will be validated before being added to the pool. If the connection fails to validate, it won't be added to the pool. |
{@code checkConnectionOnReturn} | {@code false} | Whether or not connections will be validated after being returned to the pool. If the connection fails to validate, it will be dropped from the pool. |
{@code autoCommentsEnabled} | {@code true} | Whether or not ORMs should automatically add comments. |
{@code evictionInterval} | 5 seconds | The amount of time to sleep between runs of the idle connection validation, abandoned cleaner and idle pool resizing. |
{@code validationInterval} | 30 seconds | To avoid excess validation, only run validation once every interval. |