Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- baekjoon
- CS지식
- 자바
- 스프링부트
- backjoon
- 리눅스
- Flutter
- DB
- springboot
- python
- Oracle
- postgresql
- JPA
- Spring Security
- 프로그래머스
- 네트워크
- 시큐리티
- 자바스크립트
- 자료구조
- programmers
- 데이터
- 스프링
- CS
- spring
- 파이썬
- 백준
- 플러터
- Java
- 스프링 부트 쇼핑몰 프로젝트 with JPA
- 데이터베이스
Archives
- Today
- Total
Jin's Dev Story
[SpringBoot] 환경 설정 본문
자동 갱신
1. 의존성 추가 - 추후 필요한 건 추가하면서 진행
- Spring Boot DevTools
- Lombok
- Spring Data JPA
- MySQL Driver
- Thymeleaf
- Spring Web
추가 설정
- File/Setting/Build, Exe../Build Tools/Gradle/Gradle JVM : 17로 설정
- Project Structure/Project/SDK - 17, Language level -17 or default
- Project Structure/SDKs/17
- File/Setting/Editor/File Encodings/UTF-8
2. DB 환경 설정 - application.properties 설정
- 애플리케이션 포트 설정
- server.port = 8000
- MySQL 연결 설정
- 사용할 DB 드라이버 설정
- spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
- jdbc 설정
- spring.datasource.url=jdbc:mysql://localhost:3306/shop?serverTimezone=UTC
- DB 아이디
- spring.datasource.username=root
- DB 비밀번호
- spring.datasource.password=1234
- 사용할 DB 드라이버 설정
설정 후 DBeaver에서 데이터베이스를 shop으로 생성
- JPA 설정
- 쿼리 보이게 할 건지 설정 여부
- spring.jpa.properties.hibernate.show_sql=true
- 콘솔창에 출력되는 쿼리를 가독성 좋게 포맷팅
- spring.jpa.properties.hibernate.format_sql=true
- spring.jpa.hibernate.ddl-auto=update
- 데이터베이스 언어 설정
- spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect
- 쿼리에 물음표로 줄력되는 바인드 파라미터 출력
- logging.level.org.hibernate.type.descriptor.sql=trace
- 쿼리 보이게 할 건지 설정 여부
'Web & Android > SpringBoot' 카테고리의 다른 글
[SpringBoot] 한글 변환(\u~) (0) | 2023.10.14 |
---|---|
[SpringBoot] 에러 처리 (0) | 2023.10.14 |
[SpringBoot] @Annotation (1) | 2023.10.14 |
[SpringBoot] 페이징 처리 (0) | 2023.10.14 |
[SpringBoot] ResponseEntity (0) | 2023.10.14 |