Maven 依赖

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>

Application.yml 配置

  datasource:
    driver-class-name: org.h2.Driver
    url: jdbc:h2:mem:tcm
    username: sa    # 随意配置, 网页访问时一致即可
    password: sa
  jpa:
    database: h2
    hibernate:
      ddl-auto: update
    show-sql: true
  h2:
    console:          # 注意网页版中 url、用户名、密码相一致
      enabled: true   # 开启网页访问
      path: /h2       # 网页访问路径

相关文章:

  • 2021-07-30
  • 2022-03-07
  • 2022-02-16
  • 2022-12-23
  • 2021-11-06
  • 2021-07-13
  • 2022-12-23
  • 2022-02-08
猜你喜欢
  • 2021-07-20
  • 2021-11-15
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2021-08-23
相关资源
相似解决方案