[Spring Boot] H2 DB Embedded Mode 사용하기
runtimeOnly 'com.h2database:h2'
datasource:
url: jdbc:h2:mem:testdb
username: sa
jpa:
hibernate:
ddl-auto: create-drop
show-sql: true
h2:
console:
enabled: true
settings:
web-allow-others: true
path: /h2-console
💡 h2 최신 버전은 자동으로 db를 생성해주지 않는다.
직접 생성해야 하는데 JPA ddl-auto로 쉽게 생성이 가능하다.
