Hello,
I use Quartz in 2.2.1 version
If I use RamJobStore, my task running but if I use JDBC-JobStore, my database is updated (my task is add in my tables) but the tasks not running.
Do you have an idea ?
This is my code to add task :
Code:
SchedulerFactory schdFact = new StdSchedulerFactory("conf/quartz.properties");
Scheduler sd = schdFact.getScheduler();
//Scheduler sd = StdSchedulerFactory.getDefaultScheduler();
sd.start();
JobDetail job = newJob(AlarmJob.class).withIdentity("myJob","group1").storeDurably(true).build();
Trigger trigger = newTrigger().withIdentity("mytrigger", "group1").withPriority(1).startNow().withSchedule(simpleSchedule().withIntervalInSeconds(5).repeatForever()).build();
sd.scheduleJob(job, trigger);
And this is my quartz.properies file
Code:
org.quartz.scheduler.instanceName = TestScheduler
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 4
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
#specify the jobstore used
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.useProperties = false
#The datasource for the jobstore that is to be used
org.quartz.jobStore.dataSource = myDS
#quartz table prefixes in the database
org.quartz.jobStore.tablePrefix = qrtz_
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.isClustered = false
#The details of the datasource specified previously
org.quartz.dataSource.myDS.driver = com.mysql.jdbc.Driver
org.quartz.dataSource.myDS.URL = jdbc:mysql://127.0.0.1:3306/quartz2
org.quartz.dataSource.myDS.user = root
org.quartz.dataSource.myDS.password = password
org.quartz.dataSource.myDS.maxConnections = 20
Thanks