Tomcat Data Source Configuration Properties

The configuration properties for Tomcat's standard data source resource factory (org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory) are as follows:

    • driverClassName – Fully qualified Java class name of the JDBC driver to be used.
    • maxTotal – The maximum number of active connections that can be allocated from this pool at the same time.
    • maxIdle – The maximum number of connections that can sit idle in this pool at the same time.
    • minIdle – The minimum number of idle connections that will remain in this pool at the same time.
    • maxWait – The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception.
    • password – Database password to be passed to our JDBC driver.
    • url – Connection URL to be passed to our JDBC driver. (For backwards compatibility, the property driverName is also recognized.)
    • user – Database username to be passed to our JDBC driver.
    • testWhileIdle – If the validity of the connection should be tested also when idle. Recommended to set this to true to avoid hanging connections.
    • validationQuery – SQL query that can be used by the pool to validate connections before they are returned to the application. If specified, this query must be an SQL SELECT statement that returns at least one row.