Giter Site home page Giter Site logo

spring-batch-example's Introduction

spring-batch

This is an example program for Spring Batch

This is the test of spring batch which read from db table and write to db table (mysql)

By default spring batch DataSource uses the HSQL. Here I am using JPA and set the database platform (like MySQL) to point to a specific database (other than the default HSQL).

Used Following

  • spring-batch-core 3.0.1.RELEASE
  • spring-boot-starter-batch 1.1.5.RELEASE
  • spring-boot-starter-data-jpa 1.1.5.RELEASE
  • mysql
  • gradle

I am also using gradle wrapper (http://www.gradle.org/docs/current/userguide/gradle_wrapper.html). The wrapper is something you should check into version control. By distributing the wrapper with your project, anyone can work with it without needing to install Gradle beforehand. Add following to build.gradle

  • task wrapper(type: Wrapper) { gradleVersion = '1.11' }

Command to create gradlew:-

  • gradle wrapper

I am also using Spring Boot (http://projects.spring.io/spring-boot/). This helps to create a stand-along spring app - just run the app. To make the app spring-boot add the following line to build.gradle

  • apply plugin: 'spring-boot'

  • following Dependencies:-

** compile 'org.springframework.boot:spring-boot-starter-batch:1.1.5.RELEASE'

** compile 'org.springframework.boot:spring-boot-starter-data-jpa:1.1.5.RELEASE'

Command to spring boot

  • gradlew bootRun

  • gradlew run

DDL:-

CREATE TABLE person ( id bigint(20) NOT NULL AUTO_INCREMENT, first_name varchar(45) DEFAULT NULL, last_name varchar(45) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;

CREATE TABLE account ( accountId bigint(20) NOT NULL, firstName varchar(45) DEFAULT NULL, lastName varchar(45) DEFAULT NULL, PRIMARY KEY (accountId) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO account (accountId, firstName, lastName) VALUES (1,'first name','last name');

spring-batch-example's People

Contributors

sidnan avatar

Watchers

James Cloos avatar Sergey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.