Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quartz.NET ADO.net DB Configuration

This should be a really easy question. I created the DB for Quartz.NET and populated all of the tables and stuff, now I'm just trying to configure my project to interact with the DB. I can handle the coding part of it, I just don't know what config file to use..

Thanks in advance!

like image 911
Phillip Schmidt Avatar asked Dec 21 '22 21:12

Phillip Schmidt


1 Answers

Do you have an application configuration file at all? if your application is a windows forms or windows service application, you may add an Application configuration file manually (right-click the project in your solution explorer -> Add New Item and select the "Application Configuration File"). It will end up appearing as the App.Config file in your project and when you build the project, this file will be copied to the output folder and it will be renamed to "yourappname.exe.config".

Once you have added the config file, you need to put quartz configuration to that file. For instance:

    <?xml version="1.0"?>
    <configuration>
        <configSections>
            <section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            ...
            other lines here
            ...
        </configSections>
          ...
          ...
          ...
        <quartz>

            <add key="quartz.scheduler.instanceName" value="TestQuartzServer" />
            <add key="quartz.scheduler.instanceId" value="instance_one" />
            <add key="quartz.threadPool.threadCount" value="10" />
            <add key="quartz.threadPool.threadPriority" value="Normal" />
            <add key="quartz.jobStore.misfireThreshold" value="60000" />
            <add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" />
            <add key="quartz.jobStore.useProperties" value="false" />
            <add key="quartz.jobStore.dataSource" value="default" />
            <add key="quartz.jobStore.tablePrefix" value="QRTZ_" />
            <add key="quartz.jobStore.clustered" value="true" />
            <add key="quartz.jobStore.lockHandler.type" value="Quartz.Impl.AdoJobStore.SimpleSemaphore, Quartz" />
            <!-- point this at your database -->
            <add key="quartz.dataSource.default.connectionStringName" value="ConnectionStringName" />
            <add key="quartz.dataSource.default.provider" value="SqlServer-20" />
        </quartz>
    ...
    <connectionStrings>
        <add name="ConnectionStringName" connectionString="Data Source=...; etc." providerName="System.Data.SqlClient" />
    </connectionStrings>
</configuration>
like image 107
Mikhail Avatar answered Dec 23 '22 11:12

Mikhail