Posts
Q&A
๋ช ๋ น์ด..์๋ผ์ ใ
(์ฌ์ง)๊ทธ๋๋์๋ฉ๋๋คใ ใ ์๊ทธ๋ด๊น์ ec2 ๋ฅผ ์ค๋ ๋ง๋ ๊ฑฐ๋ผ ๋ฒ์ ์ด ๋ฌ๋ผ์ ๊ทธ๋ด๊น์?
- 0
- 3
- 526
Q&A
๋๊ธฐ์ํ
์ค ๊ฐ์ฌํฉ๋๋ค ใ ใ
- 0
- 2
- 248
Q&A
pdf, ppt
์์ฝ๊ตฐ์ใ ใ ์๊ฒ ์ต๋๋ค
- 0
- 2
- 390
Q&A
๋คํธ์ํฌ ์ฑ
์ฐ์!!์ธ์ ์ฏค ์๊ธฐ๋ ์ ํด์ก์๊น์?
- 0
- 2
- 327
Q&A
ContextV1 ์ ํ ํ๋ฆฟ ์ฝ๋ฐฑ ํจํด์ด ์๋๊ฐ์?
์ ๊ฐ์ฌํฉ๋๋ค
- 0
- 2
- 307
Q&A
ํธ๋์ญ์ ์๋น์ค ๊ณ์ธต์์์ ๋ฌธ์
ํ๋ก์ ํธ ์ ์ฒด ์ฝ๋์ฌ๋ฆฝ๋๋ค ~~
- 0
- 11
- 739
Q&A
ํธ๋์ญ์ ์๋น์ค ๊ณ์ธต์์์ ๋ฌธ์
https://drive.google.com/file/d/1Hp_1iCIc0nYTqr4TfYLeYBW_c93WVP_F/view?usp=drive_link
- 0
- 11
- 739
Q&A
ํธ๋์ญ์ ์๋น์ค ๊ณ์ธต์์์ ๋ฌธ์
์๊ทธ๋ฐ๊ฑธ๊ฐ์..ใ ใ
- 0
- 11
- 739
Q&A
ํธ๋์ญ์ ์๋น์ค ๊ณ์ธต์์์ ๋ฌธ์
spring.profiles.active=local #spring.datasource.url=jdbc:h2:tcp://localhost/~/test spring.datasource.url=jdbc:h2:mem:test2 spring.datasource.username=sa #spring.datasource.password= #์ด๋ ๊ฒ ์ค์ ๋ง ํ๋ฉด ์คํ๋ง ๋ถํธ๊ฐ ํด๋น ์ค์ ์ ์ฌ์ฉํด์ ์ปค๋ฅ์ ํ๊ณผ DataSource , ํธ๋์ญ์ ๋งค๋์ ๋ฅผ ์คํ๋ง๋น์ผ๋ก ์๋ ๋ฑ๋กํ๋ค. #jdbcTemplate sql log logging.level.org.springframework.jdbc=debug #MyBatis mybatis.type-aliases-package=hello.itemservice.domain #๋ง์ด๋ฐํฐ์ค์์ ํ์ ์ ๋ณด๋ฅผ ์ฌ์ฉํ ๋๋ ํจํค์ง ์ด๋ฆ์ ์ ์ด์ฃผ์ด์ผ ํ๋๋ฐ, ์ฌ๊ธฐ์ ๋ช ์ํ๋ฉด ํจํค์ง ์ด๋ฆ์ ์๋ตํ ์ ์๋ค. #์ง์ ํ ํจํค์ง์ ๊ทธ ํ์ ํจํค์ง๊ฐ ์๋์ผ๋ก ์ธ์๋๋ค mybatis.configuration.map-underscore-to-camel-case=true logging.level.hello.itemservice.repository.mybatis=trace #์ฟผ๋ฆฌ ๋ก๊ทธ ์ถ๋ ฅ #JPA log logging.level.org.hibernate.SQL=DEBUG #ํ์ด๋ฒ๋ค์ดํธ๊ฐ ์์ฑํ๊ณ ์คํํ๋ SQL ํ์ธํ ์์์ #spring.jpa.show-sql=true #์ด ์ค์ ์ System.out ์ฝ์์ ํตํด์ SQL์ด ์ถ๋ ฅ๋๋ค. ๋ฐ๋ผ์ ์ด ์ค์ ์ ๊ถ์ฅํ์ง๋ ์๋๋ค. ( logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE #SQL์ ๋ฐ์ธ๋ฉ๋๋ ํ๋ผ๋ฏธํฐ ํ์ธ
- 0
- 11
- 739
Q&A
ํธ๋์ญ์ ์๋น์ค ๊ณ์ธต์์์ ๋ฌธ์
package hello.itemservice; import hello.itemservice.config.*; import hello.itemservice.repository.ItemRepository; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Profile; import org.springframework.jdbc.datasource.DriverManagerDataSource; import javax.sql.DataSource; //@Import(MemoryConfig.class)//MemoryConfig ๋ฅผ ์ค์ ํ์ผ๋ก ์ฌ์ฉํ๋ค. //@Import(JdbcTemplateV1Config.class) //@Import(JdbcTemplateV2Config.class) //@Import(JdbcTemplateV3Config.class) //@Import(MyBatisConfig.class) @Import(JpaConfig.class) @Slf4j @SpringBootApplication(scanBasePackages = "hello.itemservice.web")//์ดํจํค์ง ์ดํ๋ง ์ปดํฌ๋ํธ ์ค์บํ๊ณ ๋๋จธ์ง ์๋๋ฑ๋ก public class ItemServiceApplication { public static void main(String[] args) { SpringApplication.run(ItemServiceApplication.class, args); } @Bean @Profile("local")//ํน์ ํ๋กํ์ ๊ฒฝ์ฐ์๋ง ํด๋น ์คํ๋ง ๋น์ ๋ฑ๋กํ๋ค public TestDataInit testDataInit(ItemRepository itemRepository) { return new TestDataInit(itemRepository); } /*@Bean @Profile("test") public DataSource dataSource() { log.info("๋ฉ๋ชจ๋ฆฌ ๋ฐ์ดํฐ๋ฒ ์ด์ค ์ด๊ธฐํ"); DriverManagerDataSource dataSource = new DriverManagerDataSource(); dataSource.setDriverClassName("org.h2.Driver"); dataSource.setUrl("jdbc:h2:mem:db;DB_CLOSE_DELAY=-1"); dataSource.setUsername("sa"); dataSource.setPassword(""); return dataSource; }*/ }
- 0
- 11
- 739