views:

374

answers:

1

I'm using Cocoon and want to store the jobs and triggers for the quartz scheduler in the database so they are persisted. I can see where I need to make the change in cocoon.xconf but I can't find much on how to configure the datasource etc.

How do I configure this to use our existing (postgres) database?

+1  A: 

You need to do 2 things:

  • Add the following configuration to quartz.properties with appropriate values substituted for the $ placeholders


org.quartz.jobStore.dataSource=myDS
org.quartz.dataSource.myDS.URL=$URL
org.quartz.dataSource.myDS.driver=$driver
org.quartz.dataSource.myDS.maxConnections=5
org.quartz.dataSource.myDS.password=$password
org.quartz.dataSource.myDS.user=$user
org.quartz.dataSource.myDS.validationQuery=$any query that doesn't return an error when properly connected
org.quartz.jobStore.tablePrefix=QREPL_
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate


  • Create the database tables in which Quartz stores the job data - you should find a DDL script included in the Quartz distribution that will create them for you. Each of the Quartz table names should begins with the same prefix. In the configuration above, I've assumed this prefix is "QREPL_"

Hope this helps, Don

Don
Thanks Don, I don't actually have a quartz.properties file, as I am running this via cocoon, which configures quartz in its `cocoon.xconf` file. At least I have some properties to look around for now.
RodeoClown
I have no idea what Cocoon is, but I presume the same properties are still involved somehow :)
Don
Cocoon is a web development framework ( http://cocoon.apache.org/ ). Yeah, those properties need to be set - I'm just trying to figure out how. You did give me a starting point, thanks for that.
RodeoClown
I don't know how you set those properties in Cocoon, but by default Quartz just looks for a quartz.properties file on the classpath
Don