본문 바로가기

데이터베이스

스프링 부트 H2 디비 설정

gradle

runtimeOnly 'com.h2database:h2'

yml

spring:
  datasource:
    url: jdbc:h2:mem:test
    username: sa
    password:
    driver-class-name: org.h2.Driver
  jpa:
    hibernate:
      ddl-auto: create
    properties:
      hibernate:
        format_sql: true
  logging:
    level:
      org.hibernate.SQL: debug

localhost:${스프링부트 포트}/h2-console