header-img
Info :
springboot 6
list_img
Spring boot :: ์™ธ๋ถ€ http ๋ถˆ๋Ÿฌ์™€ body ๊ฐ’ ๋ฆฌํ„ดํ•˜๋Š” RequestUtil (Proxy Server ๊ธฐ๋Šฅ)
2024.02.20
๋‚ด๊ฐ€ ํ•˜๊ณ  ์‹ถ์—ˆ๋˜ ๊ฒƒ์€ http:~ ๋กœ ๋œ ์ฃผ์†Œ์— ๋‹ด๊ธด API data ๋ฅผ ๋‚ด๊ฐ€ ๊ตฌํ˜„ํ•œ ์„œ๋ฒ„์—์„œ ์ œ๊ณตํ•˜๋Š” ๊ฑฐ ์˜€์Œ. ๊ณ ๋กœ ๋‚ด๊ฐ€ ๊ตฌํ˜„ํ•œ ์„œ๋ฒ„์—์„œ ํ”„๋ก์‹œ ์„œ๋ฒ„์˜ ์—ญํ• ์„ ํ•ด์ฃผ์–ด์•ผ ํ•˜๋Š” ๊ฒƒ. ์ด๋•Œ ๋ญ RestTemplete ์ด๋‹ˆ WebClient ๋‹ˆ ์„ค์น˜ํ•˜๊ณ  ์…‹ํŒ…ํ•˜๊ณ ... ๋„ˆ๋ฌด ๊ท€์ฐฎ์•˜์Œ. ๊ทธ๋ž˜์„œ ๊ฐ„๋‹จ ver ๋กœ requestUtil ์„ ๋งŒ๋“ค์–ด๋ณด์•˜๋‹ค. import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframewo..
Springboot, Mybatis :: ๋ถ€๋“ฑํ˜ธ, ๋น„๊ต์—ฐ์‚ฐ์ž ์‚ฌ์šฉ ๋ฐฉ๋ฒ• 1
2024.02.02
์ฟผ๋ฆฌ๋ฌธ์„ ์ž‘์„ฑํ•˜๋‹ค๋ณด๋ฉด ๋น„๊ต๋ฌธ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์ƒ๊ธฐ๋Š”๋ฐ.. ๋งˆ์ด๋ฐ”ํ‹ฐ์Šค์—์„œ๋Š” , WITH CTE(WorkDate) AS ( SELECT CONVERT ( DATE, #{Year}+'-01-01') UNION ALL SELECT DATEADD(d, 1, WorkDate) FROM CTE WHERE WorkDate (CONVERT(DATE, #{Year}+'-12-31')) ) SELECT * FROM CTE OPTION ( MAXRECURSION 0 ); ๋‘˜. WITH CTE(WorkDate) AS ( SELECT CONVERT ( DATE, #{Year}+'-01-01') UNION ALL SELECT DATEADD(d, 1, WorkDate) FROM CTE WHERE ) SELECT * FROM CTE..
list_img
SpringBoot :: ์ดˆ์ดˆ์ดˆ๊ฐ„๋‹จํ•œ ๋ฐฉ๋ฒ•์œผ๋กœ ์‚ฌ์šฉ์ž ์š”์ฒญ์— ๋Œ€ํ•œ ๊ฒฝ๊ณผ์‹œ๊ฐ„ ์•Œ์•„๋ณด๊ธฐ
2024.01.16
๊ฐœ๋ฐœ ๋„์ค‘ API ํ˜ธ์ถœ ์‹œ๊ฐ„์ด ์˜ค๋ž˜๊ฑธ๋ฆฌ๋Š” ์•„์ด๋ฅผ ๋ฐœ๊ฒฌํ•˜๊ฒŒ ๋˜์—ˆ๋‹ค. DB ์‹œ๊ฐ„์€ SQL ์„ ๋•Œ๋ ค๋ณด๋ฉด ๋‚˜์˜ค๋Š”๋ฐ.. ์˜ˆ์ƒ๋งŒํผ ์˜ค๋ž˜ ๊ฑธ๋ฆฌ์ง€๋Š” ์•Š์•˜๊ณ  ๊ทธ๋ฆฌ๋“œ์— ๋ฐ์ดํ„ฐ๋ฅผ ๋ฟŒ๋ฆฌ๋Š” ๊ฒŒ ์ „๋ถ€์ธ๋ฐ๋‹ค, ๊ทธ๋ฆฌ๋“œ์˜ ๊ฒฝ์šฐ๋Š” ๋ณ„๋„ ๊ตฌํ˜„์—†์ด ์™ธ๋ถ€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉ ์ค‘์ด๋ผ์„œ ํ”„๋ก ํŠธ์—”๋“œ์˜ ๋ฌธ์ œ๋„ ์•„๋‹Œ๊ฑฐ ๊ฐ™๊ณ .. ํ˜น์‹œ ๋ชจ๋ฅด๋‹ˆ๊นŒ ๋ฐฑ์—”๋“œ ๊ฒฝ๊ณผ ์‹œ๊ฐ„์ด ์–ด๋–ป๊ฒŒ ๊ฑธ๋ฆฌ๋Š”์ง€ ํ™•์ธ์„ ํ•ด๋ณด๊ณ ์ž ํ–ˆ๋‹ค. ์†Œ์Šค ์ฝ”๋“œ // ์ปจํŠธ๋กค๋Ÿฌ ๋‹จ long startTime = System.currentTimeMillis(); List TactTimeList = tacttimeService.tacttime(paramMap); // Service ํ˜ธ์ถœ๋ถ€ long endTime = System.currentTimeMillis(); long ms = endTime - start..
Java, SpringBoot :: private ์ƒ์ˆ˜๋ฅผ private static final๋กœ ์„ ์–ธํ•˜๋Š” ์ด์œ  1
2023.12.28
static์ด๋ž€? (์ •์ ์ธ, ์›€์ง์ž„์ด ์—†๋Š”) static ์„ ์‚ฌ์šฉํ•˜์—ฌ ์„ ์–ธํ•˜๋ฉด ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ jvm์˜ static ๋ฉ”๋ชจ๋ฆฌ์— ์˜ฌ๋ผ๊ฐ€๊ฒŒ ๋œ๋‹ค. static ์˜์—ญ์˜ ๊ฒฝ์šฐ ํ”„๋กœ๊ทธ๋žจ์ด ์‹œ์ž‘ํ•˜๊ณ  ์ข…๋ฃŒํ•  ๋•Œ๊นŒ์ง€ ์‚ด์•„ ์žˆ์–ด ๋ณ„๋„์˜ ์ดˆ๊ธฐํ™” ๊ณผ์ •์„ ํ•„์š”๋กœ ํ•˜์ง€ ์•Š๊ณ  static์ด ์„ ์–ธ๋œ ๋ณ€์ˆ˜, ๋ฉ”์„œ๋“œ์— ๋ฐ”๋กœ ์ ‘๊ทผ์ด ๊ฐ€๋Šฅํ•ด์ง„๋‹ค. static์„ ์‚ฌ์šฉํ•œ๋‹ค๋Š” ์˜๋ฏธ๋Š” ํ•ด๋‹น ๊ฐ์ฒด๋ฅผ ๊ณต์œ ํ•œ๋‹ค๋Š” ์˜๋ฏธ. ๋™์ผํ•œ ๊ฐ์ฒด๋กœ ๊ฐ’๋งŒ ๋ฐ”๊พธ์–ด ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ์žฅ์ ์ด ์žˆ์Œ๊ณผ ๋™์‹œ์— ๋™์ผํ•œ ๊ฐ์ฒด๋ฅผ ๊ฐ’๋งŒ ๋ฐ”๊พธ์–ด ์‚ฌ์šฉํ•œ๋‹ค๋Š” ์ ์—์„œ ๋ณ€์ˆ˜์˜ ๊ฐ’์„ ์‹ ์ค‘ํ•˜๊ฒŒ ๋ฐ”๊พธ์–ด์•ผ ํ•œ๋‹ค๋Š” ์ƒ๊ฐ๋„ ํ•ด์•ผํ•œ๋‹ค. final์ด๋ž€? ๋ถˆ๋ณ€๊ณผ ๊ด€๋ จ๋œ ์†์„ฑ์ด ์•„๋‹ˆ๋ผ ์žฌํ• ๋‹น ๋ฐฉ์ง€์™€ ๊ด€๋ จ๋œ ์†์„ฑ. final์„ ์‚ฌ์šฉํ•˜๊ฒŒ ๋˜๋ฉด ์žฌํ• ๋‹น์ด ๋ฐฉ์ง€๋˜๋ฏ€๋กœ, ์ƒ์†์ด๋‚˜ ๊ฐ’ ์žฌ ์ดˆ๊ธฐํ™” ๋“ฑ์ด ๋ถˆ๊ฐ€๋Šฅํ•ด์ง„๋‹ค. public ..
Springboot(java) :: ๋ฌธ์ž ๊ด€๋ จ StringUtil ๋ชจ์Œ์ง‘
2023.12.27
ํŒŒ์ผ๋กœ ๋ณด๊ธฐ๋Š” ์•„๋ž˜์—.. ์•…์„ฑ์ฝ”๋“œ ็„ก only java.. /** * @Class Name : StringUtil.java * @Description : ๋ฌธ์ž์—ด ๋ฐ์ดํ„ฐ ์ฒ˜๋ฆฌ ๊ด€๋ จ ์œ ํ‹ธ๋ฆฌํ‹ฐ * @Modification Information * @author ony **/ package com.sample.controller; // ์ด๋ฆ„ ์ž„์˜ ๋ณ€๊ฒฝํ•จ import java.io.UnsupportedEncodingException; import java.math.BigDecimal; import java.security.SecureRandom; import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.Locale; public ..
list_img
SpringBoot :: Log4jdbc ๋ž€? 2
2023.11.15
Log4jdbc Log4j ๋ฅผ JDBC์™€ ์—ฐ๊ฒฐํ•˜์—ฌ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด ๋งŒ๋“ค์–ด์ง„ ์˜คํ”ˆ์†Œ์Šค ํ”„๋กœ์ ํŠธ GitHub - arthurblake/log4jdbc: log4jdbc is a Java JDBC driver that can log SQL and/or JDBC calls (and optionally SQL timing info log4jdbc is a Java JDBC driver that can log SQL and/or JDBC calls (and optionally SQL timing information) for other JDBC drivers using the Simple Logging Facade For Java (SLF4J) logging system. - G... github.com ์œ„์˜ ์ฝ”๋“œ๋Š”..