Dev/Spring Boot
Maven Spring boot h2 데이터베이스 연결
코딩하는 백구
2022. 2. 13. 20:28
application.yml
server:
port: 8080
spring:
h2:
console:
enabled: true
path: /h2-console
datasource:
url: jdbc:h2:~/test
username: sa
password: 1234
driver-class-name: org.h2.Driver
pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
localhost:8080/h2-console 접속

참고