- Spring Batch - MySQL to Flat File
- Spring Batch - MySQL to XML
- Spring Batch - CSV to XML
- Spring Batch - XML to MySQL
- Spring Batch - Basic Application
- Readers, Writers & Processors
- Spring Batch - Configuration
- Spring Batch - Application
- Spring Batch - Architecture
- Spring Batch - Environment
- Spring Batch - Overview
- Spring Batch - Home
Spring Batch Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Spring Batch - Apppcation
Almost all the examples in this tutorial contain the following files −
Configuration file (XML file)
Tasklet/processor (Java class)
Java class with setters and getters (Java class (bean))
Mapper class (Java class)
Launcher class (Java class)
Configuration File
The configuration file (XML) contains the following −
The job and step definitions.
Beans defining readers and writers.
Definition of components pke JobLauncher, JobRepository, Transaction Manager, and Data Source.
In our examples, for better understanding, we have spanided this in to two files the job.xml file (defines job, step, reader and writer) and context.xml file (job launcher, job repository, transaction manager and data source).
Mapper Class
The Mapper class, depending upon the reader, implements interfaces such as row mapper, field set mapper, etc. It contains the code to get the data from the reader and to set it to a Java class with setter and getter methods (Java Bean).
Java Bean Class
A Java class with setters and getters (Java bean) represents data with multiple values. It acts as a helper class. We will pass the data from one component (reader, writer, processer) to other in the form of object of this class.
Tasklet/processor
The Tasklet/processor class contains the processing code of the Spring Batch apppcation. A processor is a class which accepts an object that contains the data read, processes it, and returns the processed data (in the form object).
Launcher class
This class (App.java) contains the code to launch the Spring Batch apppcation.
Advertisements