1. start.spring.io 프로젝트 생성 (maven)
2. 다운로드 받은 파일 원하는 위치에 압축 풀기
3. intelliJ로 해당 파일 open 하기
4. pom.xml 세팅
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency> <!-- 커넥션풀을 위한 dependency -->
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.8.0</version>
</dependency>
<dependency> <!-- MyBatis 사용을 위한 dependency -->
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.11</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
5. application.properties 파일 세팅
#mysql
spring.datasource.url=jdbc:mysql://localhost:3306/테이블명?useSSL=false&characterEncoding=UTF-8&serverTimezone=UTC
spring.datasource.username=사용자아이디
spring.datasource.password=사용자비번
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
# mysql 추가
spring.jpa.database=mysql
# ??? sql ?? ??
spring.jpa.show-sql=true
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
6. App run > localhost:8080
'Spring Boot' 카테고리의 다른 글
spring boot - intellij에서 jsp 를 사용하기 위한 환경 설정 (0) | 2023.04.06 |
---|---|
spring mvc (1) | 2023.04.06 |