Quartz数据源配置

Quartz的集群是通过数据库通讯的,所以,要配置集群就要先建好数据库表. 在下载好的Quartz文件夹里,找到docs/dbTables文件夹,库表的sql脚本都在这里,支持db2 mysql oracle sqlserver postgres等主流的关系型数据库,选择与你的数据库对应的脚本,执行就可以了.

然后是配置properties文件,

#============================================================================
# Configure Main Scheduler Properties
#============================================================================

org.quartz.scheduler.instanceName = QuartzScheduler
org.quartz.scheduler.instanceId = AUTO
#============================================================================
# Configure ThreadPool
#============================================================================

org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
#============================================================================
# Configure JobStore
#============================================================================

org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.useProperties = false

org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
org.quartz.jobStore.useProperties=false
#如果与Spring集成,不需要下面的这个参数.
#org.quartz.jobStore.dataSource=myDS
org.quartz.jobStore.tablePrefix=QRTZ_
#配置Quratz集群,下面的参数值必须为true.
org.quartz.jobStore.isClustered=true
org.quartz.jobStore.clusterCheckinInterval=15000
#============================================================================
# 根据数据库的不同选择不同的配置
#============================================================================
#org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.CloudscapeDelegate
#org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.DB2v6Delegate
#org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.DB2v7Delegate
#org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.DriverDelegate
#org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.HSQLDBDelegate
#org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.MSSQLDelegate
#org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PointbaseDelegate
#org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
#org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
#org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.WebLogicDelegate
#org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
#org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.oracle.WebLogicOracleDelegate
#============================================================================
# 如果没有与spring集成,则需要配置下面的数据源.
#============================================================================

#org.quartz.dataSource.myDS.driver=com.ibm.db2.jcc.DB2Driver
#org.quartz.dataSource.myDS.URL=jdbc:db2://172.16.113.4:50000/UUMDB
#org.quartz.dataSource.myDS.user=db2inst1
#org.quartz.dataSource.myDS.password=zone2009
#org.quartz.dataSource.myDS.maxConnections = 5
#org.quartz.dataSource.myDS.validationQuery=

OK,对于Quartz的配置就这么多

转:Spring+Quartz集群配置(二) | I'M .K + http://www.2016k.com/programmer/java/08-93.html

猜你喜欢

转载自kent-mu.iteye.com/blog/1846296