Skip to content

The main goal is show how to import data from a comma delimited file to a Postgres Database.

Notifications You must be signed in to change notification settings

williamcrocha/springbatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

banner

About The Project

The main goal is show how to import data from a comma delimited file to a Postgres Database.

REFERENCES

OVERVIEW

In this project we use a Spring Batch to import a comma delimited file into a Postgres table. Spring Batch is a very powerfull tool with many capabilities. Check Spring Batch documentation for more info.


TESTING

  1. Start your servers instances with Docker. Open the terminal / command prompt, go to the application folder and type:
docker-compose up -d
  1. Open another terminal, go to the application folder/target and type:
docker exec -it postgres bash OR docker exec -it <container id> bash 
  1. Once inside, login into Postgres server:
psql -d testdb -U postgres
  1. Checking if table is empty OR not exist:
SELECT * FROM person;
  1. Open another terminal, go to the application folder/target and type:
java -jar importing-0.0.1-SNAPSHOT.jar --file.input=..\src\main\resources\idNomCpf.txt
  1. Return to MySQL terminal and type:
SELECT * FROM person;

About

The main goal is show how to import data from a comma delimited file to a Postgres Database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages