Contents | ‹ Prev | Next ›

Quartz Enterprise Job Scheduler 1.x Configuration Reference

Configure DataSources

If you’re using JDBC-Jobstore, you’ll be needing a DataSource for its use (or two DataSources, if you’re using JobStoreCMT).

DataSources can be configured in three ways:

It is recommended that your Datasource max connection size be configured to be at least the number of worker threads in the thread pool plus three. You may need additional connections if your application is also making frequent calls to the scheduler API. If you are using JobStoreCMT, the “non managed” datasource should have a max connection size of at least four.

Each DataSource you define (typically one or two) must be given a name, and the properties you define for each must contain that name, as shown below. The DataSource’s “NAME” can be anything you want, and has no meaning other than being able to identify it when it is assigned to the JDBCJobStore.

Quartz-created DataSources are defined with the following properties:

Property Name Required Type Default Value
org.quartz.dataSource.NAME.driver yes String null
org.quartz.dataSource.NAME.URL yes String null
org.quartz.dataSource.NAME.user no String ""
org.quartz.dataSource.NAME.password no String ""
org.quartz.dataSource.NAME.maxConnections no int 10
org.quartz.dataSource.NAME.validationQuery no String null


Must be the java class name of the JDBC driver for your database.


The connection URL (host, port, etc.) for connection to your database.


The user name to use when connecting to your database.


The password to use when connecting to your database.


The maximum number of connections that the DataSource can create in it’s pool of connections.


Is an optional SQL query string that the DataSource can use to detect and replace failed/corrupt connections. For example an oracle user might choose “select table_name from user_tables” - which is a query that should never fail - unless the connection is actually bad.

Example of a Quartz-defined DataSource

org.quartz.dataSource.myDS.driver = oracle.jdbc.driver.OracleDriver
org.quartz.dataSource.myDS.URL = jdbc:oracle:thin:@
org.quartz.dataSource.myDS.user = myUser
org.quartz.dataSource.myDS.password = myPassword
org.quartz.dataSource.myDS.maxConnections = 30

References to Application Server DataSources are defined with the following properties:

Property Name Required Type Default Value
org.quartz.dataSource.NAME.jndiURL yes String null
org.quartz.dataSource.NAME.java.naming.factory.initial no String null
org.quartz.dataSource.NAME.java.naming.provider.url no String null
org.quartz.dataSource.NAME.java.naming.security.principal no String null
org.quartz.dataSource.NAME.java.naming.security.credentials no String null


The JNDI URL for a DataSource that is managed by your application server.


The (optional) class name of the JNDI InitialContextFactory that you wish to use.


The (optional) URL for connecting to the JNDI context.


The (optional) user principal for connecting to the JNDI context.


The (optional) user credentials for connecting to the JNDI context.

Example of a Datasource referenced from an Application Server


Custom ConnectionProvider Implementations

Property Name Required Type Default Value
org.quartz.dataSource.NAME.connectionProvider.class yes String (class name) null


The class name of the ConnectionProvider to use. After instantiating the class, Quartz can automatically set configuration properties on the instance, bean-style.

Example of Using a Custom ConnectionProvider Implementation

org.quartz.dataSource.myCustomDS.connectionProvider.class = com.foo.FooConnectionProvider
org.quartz.dataSource.myCustomDS.someStringProperty = someValue
org.quartz.dataSource.myCustomDS.someIntProperty = 5