본문 바로가기
개발/SpringBoot

[SpringBoot] application.yml - h2 database

by yo.na 2022. 6. 3.
server:
  port: 8080
  servlet:
    context-path: /
    encoding:
      charset: UTF-8
      enabled: true
      force: true

spring:
  datasource:
#    url: jdbc:h2:tcp://localhost/~/test    // local
    url: jdbc:h2:mem:testdb // in-memory
    driver-class-name: org.h2.Driver
    username: sa
    password:
    initialize: true
  h2:
    console:
      enabled: true
  sql:
    init:
      mode: always
      schema-locations: classpath*:schema.sql


  jpa:
#    defer-datasource-initialization: true
    hibernate:
      ddl-auto: create #create update none
    show-sql: true