需要注意的是:
编辑yml文件时不能使用TAB键来缩进,否则启动会报错。
键值之间需要一个空格,比如enabled: true 即true前面其实是有一个空格的,否则会报错。
1、h2数据库的配置:
h2:
console:
enabled: true
path: '/h2'
datasource:
driver-class-name: org.h2.Driver
url: 'jdbc:h2:tcp://localhost/~/oai'
username: sa
password: ''
continue-on-error: true
tomcat.max-wait: 5000
tomcat.test-on-borrow: true
schema: 'classpath:ddl/oai.ddl'
2、设置运行时控制台是否实时显示sql操作,以及是否运行通过ddl文件自动更新表结构到数据库。
jpa:
show-sql: true
hibernate:
ddl-auto: update