内置在springBoot中,java代码编写,可以在内存中运行,轻量,一般测试使用
    导入依赖
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
    <scope>runtime</scope>
    </dependency>
    yaml配置

    1. server:
    2. port: 80
    3. spring:
    4. h2:
    5. console:
    6. #开启控制台操作
    7. enabled: true
    8. path: /h2
    9. #初始化配置数据源
    10. datasource:
    11. url:
    12. hikari:
    13. driver-class-name:
    14. username:
    15. password: