db 변수 변경 및 Config 리팩터링

This commit is contained in:
kimjihun
2024-07-21 15:10:21 +09:00
parent 3e2e86e870
commit dd03e64a03
3 changed files with 4 additions and 14 deletions

View File

@@ -5,7 +5,6 @@ import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.orm.jpa.JpaTransactionManager; import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter; import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
@@ -55,10 +54,4 @@ public class DataDBConfig {
return transactionManager; return transactionManager;
} }
// @Bean
// public JdbcTemplate jdbcTemplate() {
//
// return new JdbcTemplate(dataDBSource());
// }
} }

View File

@@ -3,11 +3,7 @@ package com.example.springbatch.controller;
import org.springframework.batch.core.Job; import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobParameters; import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.JobParametersBuilder; import org.springframework.batch.core.JobParametersBuilder;
import org.springframework.batch.core.JobParametersInvalidException;
import org.springframework.batch.core.launch.JobLauncher; import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException;
import org.springframework.batch.core.repository.JobRestartException;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;

View File

@@ -5,15 +5,16 @@ server.port=8080
spring.datasource-meta.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource-meta.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource-meta.jdbc-url=jdbc:mysql://144.24.71.211:3306/meta_db?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true spring.datasource-meta.jdbc-url=jdbc:mysql://144.24.71.211:3306/meta_db?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true
spring.datasource-meta.username=user1 spring.datasource-meta.username=user1
spring.datasource-meta.password=vmfhaltmskdls123 spring.datasource-meta.password=vmfhaltmskdls12345
spring.datasource-data.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource-data.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource-data.jdbc-url=jdbc:mysql://144.24.71.211:3306/data_db?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true spring.datasource-data.jdbc-url=jdbc:mysql://144.24.71.211:3306/data_db?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true
spring.datasource-data.username=user1 spring.datasource-data.username=user1
spring.datasource-data.password=vmfhaltmskdls123 spring.datasource-data.password=vmfhaltmskdls12345
spring.batch.job.enabled=false spring.batch.job.enabled=false
#spring.batch.job.name=firstJob #spring.batch.job.name=firstJob
spring.batch.jdbc.initialize-schema=always spring.batch.jdbc.initialize-schema=never
spring.batch.jdbc.schema=classpath:org/springframework/batch/core/schema-mysql.sql