1. 의존성 추가
runtimeOnly 'com.h2database:h2'
2. 설정 추가
#h2설정
#h2 console 설정
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
#h2 db 설정
spring.datasource.url=jdbc:h2:~/db이름;
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect
#jpa hibernate 설정
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.hibernate.ddl-auto=update