본문 바로가기

Spring

h2-console 연동하기

728x90

Memory

application.properties

spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:mem:db이름
spring.datasource.username= sa
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver

Server

DB 생성

DB 생성 후 이후 접속

application.properties

spring.datasource.url=jdbc:h2:tcp://localhost/~/DB이름
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver

 

[H2] Database (디렉토리 경로) not found, either pre-create it or allow remote database creation 오류 시 DB 만들기

윈도우 시스템 트레이 아이콘을 클릭하여 H2-console 접속 후 생성가능

728x90

'Spring' 카테고리의 다른 글

Springdoc을 이용한 swagger3 구현  (0) 2023.04.10
Entity를 변경하는 방법(Merge와 변경감지)  (0) 2023.04.07
JPQL  (0) 2023.03.27
값 타입 컬렉션  (0) 2023.03.27
임베디드 타입  (0) 2023.03.27