Springboot 配置H2数据库

1. 配置文件

Springboot 配置H2数据库_第1张图片

	spring.thymeleaf.cache=false
	spring.resources.cache-period=0
	server.port=80
	 
	spring.datasource.url=jdbc:h2:file:./db/test01
	#spring.datasource.url=jdbc:h2:mem:test
	#spring.datasource.url=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
	spring.datasource.driverClassName=org.h2.Driver
	spring.datasource.username=sa
	spring.datasource.password=
	 
	#spring.datasource.schema=classpath:db/schema.sql
	#resources/db/schema.sql
	#spring.datasource.data=classpath:db/data.sql    
	#resources/db/data.sql
	 
	spring.h2.console.settings.web-allow-others=true
	spring.h2.console.path=/h2
	spring.h2.console.enabled=true
	 
	spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
	spring.jpa.generate-ddl=true
	spring.jpa.show-sql=true
	spring.jpa.hibernate.ddl-auto=update
	spring.datasource.platform=h2
	 
	logging.level.root=INFO
	logging.level.org.hibernate=INFO
	logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
	logging.level.org.hibernate.type.descriptor.sql.BasicExtractor=TRACE
	logging.level.com.sguess=DEBUG

 

2. 配置信息

 

Springboot 配置H2数据库_第2张图片

3. 网页访问

       Springboot 配置H2数据库_第3张图片

     

    Springboot 配置H2数据库_第4张图片

你可能感兴趣的:(Spring,SpringBoot,H2)