작업제목 : 스프링(부트 포함) 배치 프로그램(SELECT 후 INSERT DB)
작업순서 : 
1. 스프링 부트 pom.xml 설정
2. BatchVO.class, BatchConfiguration.class, BatchJob.class, BatchApplication.class 생성
3. BatchConfiguration.class 작성
4. BatchVO.class 작성
5. BatchJob.class 작성
6. BatchApplication.class 작성
7. 기타 설정 확인
8. 정상 작동되는지 테스트 및 확인
9. jar 파일로 생성
10. bat 파일 생성 후 bat 파일로 실행
11. 윈도우 스케줄러에 등록하여 특정 시간에 bat 파일이 작동되도록 구성
배치 프로그램이 정상 실행되기 위한 기타 설정 파일들을 살펴보도록하자.

기본적으로 세팅되어야 할 application.properties
spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
spring.datasource.url=jdbc:oracle:thin:@//localhost:1522/xe
spring.datasource.username=system
spring.datasource.password=1234
DB에서 값을 reading, writing 해야 할 database.properties
jdbc.driverClassName=oracle.jdbc.OracleDriver
jdbc.url=jdbc:oracle:thin:@//localhost:1522/xe
jdbc.username=system
jdbc.password=1234
프로젝트 시작전 DB 설정을 위한 sql 파일
drop table total_count;
create table total_count(
create_date date,
count int);
insert into total_count(create_date, count) values(sysdate,(select count(num) from user_registration));

+ Recent posts