Ado JobStore使用!
好吧,我是 Quartz 的新手,我正在关注 本教程
并配置了我的调度程序实例和石英来使用此属性:
properties["quartz.jobStore.lockHandler.type"] = "Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz";
properties["quartz.jobStore.driverDelegateType"] = "Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz";
properties["quartz.jobStore.dataSource"] = "default";
properties["quartz.dataSource.default.connectionString"] = "Server=loclahost;Initial Catalog=aleo;Persist Security Info=True;User ID=userid;Password=password";
properties["quartz.dataSource.default.provider"] = "SqlServer-20";
properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz";
properties["quartz.jobStore.useProperties"] = "true";
properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
ISchedulerFactory schedFact = new Quartz.Impl.StdSchedulerFactory(properties);
IScheduler sched = schedFact.GetScheduler();
sched.Start();
但是下一步是什么?我是 C# 新手,但如果有人解释就能理解:)
我的问题是如何将作业、触发器和其他内容添加到数据库中?
我还创建了 Quartz API 附带的 Database/tables 文件夹中给出的表 谢谢。
well i'm new in Quartz i'm following this tutorial
and i configured my scheduler instance and quartz to use this properties:
properties["quartz.jobStore.lockHandler.type"] = "Quartz.Impl.AdoJobStore.UpdateLockRowSemaphore, Quartz";
properties["quartz.jobStore.driverDelegateType"] = "Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz";
properties["quartz.jobStore.dataSource"] = "default";
properties["quartz.dataSource.default.connectionString"] = "Server=loclahost;Initial Catalog=aleo;Persist Security Info=True;User ID=userid;Password=password";
properties["quartz.dataSource.default.provider"] = "SqlServer-20";
properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz";
properties["quartz.jobStore.useProperties"] = "true";
properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
ISchedulerFactory schedFact = new Quartz.Impl.StdSchedulerFactory(properties);
IScheduler sched = schedFact.GetScheduler();
sched.Start();
but what's next? i am new on C# but if someone explain to can understand :)
and my question are how i will add jobs and triggers and stuff to the database?
i also created the tables given in the Database/tables folder that comes with Quartz API
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于谁来说:嗯,我问这个问题是因为我不知道 Quartz.net 提供了很多很好的例子:) 一旦你将属性 Collection 作为 StdSchedulerFactory 方法的参数,你就得到了你的调度程序,您所要做的就是像在 RamJobStore 上一样继续工作,作业或触发器将存储在数据库中而不是存储在 Ram 内存中:) 祝您好运!
For whom it may concerns: well, i asked this question because i didn't know that Quartz.net comes with a bunch of good examples :) once you give the properties Collection as an argument to the StdSchedulerFactory method, and you get your scheduler, all you have to do is to keep working as you are on RamJobStore, and the job or triggers will be stored in the database not on the Ram Memory :) good luck!