Skip to content

Latest commit

 

History

History

SpringBatchXmlToDatabase

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

SpringBatchXmlToDatabase

Runtime Environment

Short & Quick introduction

Create Database Table

create table EXAM_RESULT (
   student_name VARCHAR(30) NOT NULL,
   dob DATE NOT NULL,
   percentage double NOT NULL
);

Prepare/review the input XML file and corresponding domain object /mapped POJO

  • src/main/resources/examResult.xml
  • com.websystique.springbatch.model.ExamResult
  • com.websystique.springbatch.LocalDateAdapter

Create an ItemProcessor

  • com.websystique.springbatch.ExamResultItemProcessor

Add a Job listener(JobExecutionListener)

  • com.websystique.springbatch.ExamResultJobListener

Add a custom Converter to handle the Date conversion

  • com.websystique.springbatch.ExamResultItemPreparedStatementSetter

Create Spring Context with job configuration

  • src/main/resource/context-datasource.xml
  • src/main/resource/spring-batch-context.xml

Create Main application to finally run the job

  • com.websystique.springbatch.Main

Links