spring-batch tutorial

7
Spring-Batch Tutorial Getting Started Guide

Upload: adam-england

Post on 31-Dec-2015

54 views

Category:

Documents


0 download

DESCRIPTION

Spring-Batch Tutorial. Getting Started Guide. Agenda. Software prerequisites Creating new batch application Setting up database Running a job. Prerequisites. JDK 1.4 or later Maven 2. Create a batch application. Use the spring-batch-app archetype mvn archetype:create - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Spring-Batch Tutorial

Spring-Batch Tutorial

Getting Started Guide

Page 2: Spring-Batch Tutorial

Agenda Software prerequisites Creating new batch application Setting up database Running a job

Page 3: Spring-Batch Tutorial

Prerequisites JDK 1.4 or later Maven 2

Page 4: Spring-Batch Tutorial

Create a batch application Use the spring-batch-app archetype

mvn archetype:create -DarchetypeGroupId=org.springframework.batch -DarchetypeArtifactId=spring-batch-app -DarchetypeVersion=1.0-SNAPSHOT -DgroupId=org.myorganization -DartifactId=my-app-name

Page 5: Spring-Batch Tutorial

Setup the database Create a schema using SQL script from/src/main/resources/db-schema-scripts

Edit JDBC connection properties in/src/main/resource/batch-jdbc.properties

Page 6: Spring-Batch Tutorial

Run a job cd path/to/my-app-name mvn test mvn exec:exec

Page 7: Spring-Batch Tutorial

Look behind the curtains src/main/resources/helloWorldJob.xml

contains the job configuration pom.xml contains the maven’s exec plugin

configuration which launches the job with appropriately configured classpath