fix: sql log format fix

CUD return int fix
     local yml fix
main
minuk926 2 years ago
parent 828a7e5ccc
commit 827d7b6c45

@ -82,7 +82,7 @@ public class CtgyFileMgtController {
String absFile = ""; String absFile = "";
if (Arrays.asList(env.getActiveProfiles()).contains("prod")) if (Arrays.asList(env.getActiveProfiles()).contains("local"))
absFile = dto.getInFileurl() + File.separator + dto.getInFilename(); absFile = dto.getInFileurl() + File.separator + dto.getInFilename();
else else
absFile = rootPath + dto.getInFileurl().split(serviceUrl)[1] + File.separator + dto.getInFilename(); absFile = rootPath + dto.getInFileurl().split(serviceUrl)[1] + File.separator + dto.getInFilename();
@ -129,7 +129,7 @@ public class CtgyFileMgtController {
String absFile = ""; String absFile = "";
if (Arrays.asList(env.getActiveProfiles()).contains("prod")) if (Arrays.asList(env.getActiveProfiles()).contains("local"))
absFile = entity.getInFileurl() + File.separator + entity.getInFilename(); absFile = entity.getInFileurl() + File.separator + entity.getInFilename();
else else
absFile = rootPath + entity.getInFileurl().split(serviceUrl)[1] + File.separator + entity.getInFilename(); absFile = rootPath + entity.getInFileurl().split(serviceUrl)[1] + File.separator + entity.getInFilename();

@ -334,7 +334,7 @@ public abstract class BaseMpowerDaoSupport {
} }
private String getQueryXml(String syntax, String sql){ private String getQueryXml(String syntax, String sql){
log.info(sql); log.info("\n{}",sql);
return String.format( return String.format(
"%s%s%s%s%s%s%s", "%s%s%s%s%s%s%s",
"<?xml version='1.0' encoding='euc-kr'?>\n<QUERYS DBNAME='", "<?xml version='1.0' encoding='euc-kr'?>\n<QUERYS DBNAME='",
@ -369,6 +369,7 @@ public abstract class BaseMpowerDaoSupport {
Objects.requireNonNull(sql, "SQL cannot be null"); Objects.requireNonNull(sql, "SQL cannot be null");
Client client = null; Client client = null;
int rtn = 0;
try { try {
client = getConnection(); client = getConnection();
client.setInput("SQLXML", getQueryXml(syntax, sql)); client.setInput("SQLXML", getQueryXml(syntax, sql));
@ -377,11 +378,11 @@ public abstract class BaseMpowerDaoSupport {
String result = client.getString("result", 0, 0); String result = client.getString("result", 0, 0);
if (result.equals("true")){ if (result.equals("true")){
System.out.println("<<<<<<<<<<<<===========#$#$#$$##$#$$#$#$$$$$$$====>>>>>>>>>"); rtn = 1;
}else{ }else{
throw new MpowerException("SQL 오류::"+result); throw new MpowerException("SQL 오류::"+result);
} }
return 1; return rtn;
}catch (MpowerException e){ }catch (MpowerException e){
throw e; throw e;

@ -8,66 +8,26 @@ spring:
sql: sql:
init: init:
mode: always mode: always
platform: h2 #postgres platform: oracle
#schema-locations: classpath:/data/h2/schema.sql #schema-locations: classpath:/data/h2/schema.sql
#data-locations: #data-locations:
# - classpath:/data/h2/TRAFFIC_MIN_USERINFO.sql # - classpath:/data/h2/TRAFFIC_MIN_USERINFO.sql
# - classpath:/data/h2/TRAFFIC_MIN_SIMSA_USER680.sql # - classpath:/data/h2/TRAFFIC_MIN_SIMSA_USER680.sql
# ================================================================================================================== # ==================================================================================================================
# database setting # logging lib setting
# ================================================================================================================== # ==================================================================================================================
datasource:
# driver-class-name: org.postgresql.Driver #org.h2.Driver
# url: jdbc:postgresql://localhost:5432/bustms
# username: traffic
# password: xhdgkq0
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:xitdb;MODE=Oracle;DATABASE_TO_LOWER=TRUE;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
username: sa
password: ''
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
read-only: false
# ==================================================================================================================
# JPA setting
# ==================================================================================================================
jpa:
database-platform: org.hibernate.dialect.PostgreSQLDialect
#show-sql: false
properties:
hibernate:
hbm2ddl:
# create / create-drop / update / validate / none
auto: create-drop
h2:
console:
enabled: true
path: /h2-console
# ==================================================================================================================
# JPA logging lib setting
# ==================================================================================================================
decorator:
datasource:
p6spy:
enable-logging: true
logging: logging:
level: level:
# spring.mvc.log-request-details=debug 활성화 # spring.mvc.log-request-details=debug 활성화
web: debug web: debug
root: info root: info
# hibernate sql log 출력시 변수 바인딩
org: org:
#hibernate: springframework:
#type: trace transaction:
interceptor: TRACE
orm:
jpa: TRACE
# ================================================================================================================== # ==================================================================================================================
# Spring-doc 활성 # Spring-doc 활성

Loading…
Cancel
Save