内置在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配置
server:
port: 80
spring:
h2:
console:
#开启控制台操作
enabled: true
path: /h2
#初始化配置数据源
datasource:
url:
hikari:
driver-class-name:
username:
password: