@@ -0,0 +1,2197 @@
+package com.lance.quartz.common.config;%0A%0Aimport java.io.IOException;%0Aimport java.util.Properties;%0A%0Aimport org.quartz.Scheduler;%0Aimport org.quartz.SchedulerException;%0Aimport org.quartz.SchedulerFactory;%0Aimport org.quartz.impl.StdSchedulerFactory;%0Aimport org.springframework.context.annotation.Bean;%0Aimport org.springframework.context.annotation.Configuration;%0A%0A/**%0A * %E9%85%8D%E7%BD%AE%E4%BB%BB%E5%8A%A1%E8%B0%83%E5%BA%A6%E4%B8%AD%E5%BF%83%0A * %5BQRTZ_JOB_DETAILS%5D, %5BQRTZ_TRIGGERS%5D and %5BQRTZ_CRON_TRIGGERS%5D%0A * @author lance%0A */%0A@Configuration%0Apublic class QuartzConfig %7B%0A%0A%09@Bean%0A%09public Scheduler scheduler() throws IOException, SchedulerException %7B%0A%09%09SchedulerFactory schedulerFactory = new StdSchedulerFactory(quartzProperties());%0A%09%09Scheduler scheduler = schedulerFactory.getScheduler();%0A%09%09scheduler.start();%0A%09%09return scheduler;%0A%09%7D%0A%09%0A%09/**%0A%09 * %E8%AE%BE%E7%BD%AEquartz%E5%B1%9E%E6%80%A7%0A%09 * @throws IOException%0A%09 * 2016%E5%B9%B410%E6%9C%888%E6%97%A5%E4%B8%8B%E5%8D%882:39:05%0A%09 */%0A%09public Properties quartzProperties() throws IOException %7B%0A%09%09Properties prop = new Properties();%0A%09%09prop.put(%22quartz.scheduler.instanceName%22, %22ServerScheduler%22);%0A%09%09prop.put(%22org.quartz.scheduler.instanceId%22, %22AUTO%22);%0A%09%09prop.put(%22org.quartz.scheduler.skipUpdateCheck%22, %22true%22);%0A%09%09prop.put(%22org.quartz.scheduler.instanceId%22, %22NON_CLUSTERED%22);%0A%09%09prop.put(%22org.quartz.scheduler.jobFactory.class%22, %22org.quartz.simpl.SimpleJobFactory%22);%0A%09%09prop.put(%22org.quartz.jobStore.class%22, %22org.quartz.impl.jdbcjobstore.JobStoreTX%22);%0A%09%09prop.put(%22org.quartz.jobStore.driverDelegateClass%22, %22org.quartz.impl.jdbcjobstore.StdJDBCDelegate%22);%0A%09%09prop.put(%22org.quartz.jobStore.dataSource%22, %22quartzDataSource%22);%0A%09%09prop.put(%22org.quartz.jobStore.tablePrefix%22, %22QRTZ_%22);%0A%09%09prop.put(%22org.quartz.jobStore.isClustered%22, %22true%22);%0A%09%09prop.put(%22org.quartz.threadPool.class%22, %22org.quartz.simpl.SimpleThreadPool%22);%0A        prop.put(%22org.quartz.threadPool.threadCount%22, %225%22);%0A%0A%09%09prop.put(%22org.quartz.dataSource.quartzDataSource.driver%22, %22com.mysql.jdbc.Driver%22);%0A%09%09prop.put(%22org.quartz.dataSource.quartzDataSource.URL%22, %22jdbc:mysql://localhost:3306/web-system%22);%0A%09%09prop.put(%22org.quartz.dataSource.quartzDataSource.user%22, %22root%22);%0A%09%09prop.put(%22org.quartz.dataSource.quartzDataSource.password%22, %22123456%22);%0A%09%09prop.put(%22org.quartz.dataSource.quartzDataSource.maxConnections%22, %2210%22);%0A%09%09return prop;%0A%09%7D%0A%7D

add quartz config