集成H2
Springboot配置
## h2
spring.datasource.name=h2
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.url=jdbc:h2:file:./data/db/h2/test;DB_CLOSE_DELAY=-1;MODE=MYSQL;DATABASE_TO_LOWER=TRUE;AUTO_SERVER=TRUE;AUTO_RECONNECT=TRUE
spring.datasource.username=sa
spring.datasource.password=
异常信息
启动时报异常:org.h2.jdbc.JdbcSQLSyntaxErrorException: Schema "PUBLIC" not found;
排查原因,最后确定与jdbc参数转小写有关,去掉DATABASE_TO_LOWER=TRUE后启动成功。