From the course: Spring: Spring Batch

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Configuring a job repository

Configuring a job repository

From the course: Spring: Spring Batch

Start my 1-month free trial

Configuring a job repository

- [Instructor] Spring batch uses the job repository to store metadata about the execution of a batch job. Up until this point, this metadata was stored in an in-memory H2 database. This isn't very useful since we'll lose the metadata with every execution of a job. In this lesson, we're going to set up our job repository to connect to our MySQL database. That way, we can store the metadata regarding our job executions persistently across different runs of jobs. So in order to do that, we need to add a new dependency into our palm.xml file, and that dependency is going to be for the MySQL database driver. Now Currently, we have the H2 database configured, we're just going to reuse that dependency section to set up our MySQL driver, and we'll remove H2 in the process. So anytime we're using a Maven dependency, we need a group ID. In this case, it's going to be mysql. And we also need an artifact ID. In this case, it's…

Contents