Loading Jobs into the Database
Earlier in the section , "Using Memory to Store Scheduler Information," we talked about how to load job and trigger information into memory when using the RAMJobStore. So how are jobs and triggers loaded into the database? Several methods exist for getting job information into the database:
We talked about the first two approaches back in the RAMJobStore section. When used with a JDBC JobStore, the approach is not much different, with a few exceptions. First, you need to understand that when using these two methods, the job information is in the database. Even if you stop the application, the information remains in the database. Even if you took the JobInitializationPlugin out of your application, the information would be in the database. In that sense, it is seeding the database with job information. Chapter 8 covers the JobInitializationPlugin and Quartz plug-ins in general.
The last approach is probably the most interesting one. We haven't yet talked about the Quartz Web application, but we do in Chapter 13, "Quartz and Web Applications." For now, you should know that the Quartz Web application is a browser-based GUI that is designed to manage the Quartz Scheduler. It was designed by Quartz users and presents a rather nice interface for adding jobs and triggers, starting and pausing the Scheduler, and delivering other functionality.
Loading Jobs via a SQL Tool
One last method can be used to load job information, but it's mentioned here only to discourage you from attempting it. This approach is to use native SQL and attempt to load and/or modify the information directly into the Quartz tables. Adding job information to the database using a native query tool works in some rare cases, but it's easy to corrupt the data and cause none of the jobs to function correctly. Avoid this approach at all costs.
Using the JobStoreCMT