你如何使用 Quartz.net 建立一个作业商店。他们在网站上的教程对我没有帮助。
在这个页面虽然有步骤 http://quartznet.sourceforge.net/tutorial/lesson_9.html 我无法得到如何设置这个
org.quartz.jobStore.type = Quartz.Impl.AdoJobStore.JobStoreTX, Quartz
谢谢
你如何使用 Quartz.net 建立一个作业商店。他们在网站上的教程对我没有帮助。
在这个页面虽然有步骤 http://quartznet.sourceforge.net/tutorial/lesson_9.html 我无法得到如何设置这个
org.quartz.jobStore.type = Quartz.Impl.AdoJobStore.JobStoreTX, Quartz
谢谢
这是 Quartz.NET 的示例 13 中改编的编程配置示例:
NameValueCollection properties = new NameValueCollection();
properties["quartz.scheduler.instanceName"] = "TestScheduler";
properties["quartz.scheduler.instanceId"] = "instance_one";
properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz";
properties["quartz.jobStore.useProperties"] = "true";
properties["quartz.jobStore.dataSource"] = "default";
properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
// if running MS SQL Server we need this
properties["quartz.jobStore.lockHandler.type"] = "Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz";
properties["quartz.dataSource.default.connectionString"] = "Server=(local);Database=quartz;Trusted_Connection=True;";
properties["quartz.dataSource.default.provider"] = "SqlServer-20";
// First we must get a reference to a scheduler
ISchedulerFactory sf = new StdSchedulerFactory(properties);
IScheduler sched = sf.GetScheduler();
您还可以使用基于属性文件的方法(.config 文件)来实现相同的目的。
Quartz 3.1 及更高版本的更新
如果您正在使用 Microsoft 依赖注入,您还可以使用 Quartz.NET 3.1 中引入的 fluent Microsoft DI 注册 API。有关详细信息,请参阅配置指南。