2009-09-21 2 views
22

어떻게 Quartz.net으로 jobstore를 설정 하시겠습니까? 그들이 사이트에서 가지고있는 자습서는 나를 위해 도움이되지 않습니다. 단계가 있습니다하지만이 페이지에서 Quartz.net에서 ADOJobStore 구성하기

http://quartznet.sourceforge.net/tutorial/lesson_9.html 내가 Quartz.NET의 예 13에서

다음
+1

여기에 대한 자세한 정보가 있습니다. http://stackoverflow.com/questions/3821804/ado-net-with-quartz-net/21786658#21786658 –

답변

38

는 프로그램 구성의 적용 예제이 하나

org.quartz.jobStore.type = Quartz.Impl.AdoJobStore.JobStoreTX, Quartz 

감사를 설정하는 방법을 얻을 수 아니다 :

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(); 

속성 파일 기반 앱에서도 동일한 결과를 얻을 수 있습니다. roach (.config 파일).

+0

Marko는 귀하의 회신에 감사드립니다. 모든 테이블을 만들었지 만 QRTZ_Triggers 테이블에서 start_Time과 End_Time은 큰 int 열입니다. 시작 시간을 11:30 또는 14:25로 지정하는 방법은 무엇입니까? 그리고 Scheduler 인스턴스를 얻은 후에 데이터베이스에서 트리거를 반복해야합니까 ?? 또는 당신을 위해 어떤 예제가있다 – acadia

+0

당신은 스케줄러 인터페이스를 통해 모든 변경을해야합니다, 당신은 데이터베이스에서 직접 테이블의 내용을 변경해서는 안됩니다. JobStoreTX를 사용하면 트리거와 작업 세부 정보가 데이터베이스에 유지됩니다. –

+0

ClusterExample.cs에서 예제 13의 코드를 내 Quartz Server의 설정 파일로 가져 오는 방법을 알아 내려고 노력 중이므로 프로그래밍 방식의 설정이 없으므로 알아낼 수 없습니다. 심지어 가능할까요? – Snowy