img
.
Table 20-4. Maven Dependencies for Spring Batch and Castor
Group ID
Artifact ID
Version
Description
2.1.8.RELEASE Spring Batch core library. Classes
org.springframework.batch
spring-batch-core
that support batch job
configuration, job launchers, and so
on, are packaged in this module.
2.1.8.RELEASE Spring Batch infrastructure library.
org.springframework.batch
spring-batch-
infrastructure
For example, classes that support
various readers and writers (for
example, file, database, and so on)
are packaged in this module.
3.1.0.RELEASE Spring OXM module for supporting
org.springframework
spring-oxm
transformation between POJOs and
XML format.
1.3.2
Castor XML library.
org.codehaus.castor
castor-xml
Add the dependencies in Table 20-4 into the project in STS.
Spring Batch Infrastructure Configuration
To use Spring Batch, a few setup and configuration tasks are required. First, the schema for creating the
metadata tables for storing Spring Batch operational data should be included during the database
initialization process.
In the contact application, we are using the embedded H2 database, which is defined in the file
/src/main/resources/datasource-tx-jpa.xml. Listing 20-1 shows the code snippet for the change
required for the file.
Listing 20-1. Adding the Spring Batch Schema Script
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
<!-- Other code omitted -->
<jdbc:embedded-database id="dataSource" type="H2">
<jdbc:script location="classpath:schema.sql"/>
<jdbc:script location="classpath:/org/springframework/batch/core/schema-h2.sql"/>
<jdbc:script location="classpath:test-data.sql"/>
</jdbc:embedded-database>
<!-- Other code omitted -->
</beans>
Search WWH :
Custom Search
Previous Page
Spring Framework 3 Topic Index
Next Page
Spring Framework 3 Bookmarks
Home