1.修改application.yml
spring:datasource: url: jdbc:sqlserver://localhost:1433;DatabaseName=test driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver type: com.alibaba.druid.pool.DruidDataSourcejackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8
注意对齐,在spring下,我用的sqlserver数据库,所以数据库配置不用调整
如果是mysql数据库,则
datasource:
druid:
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2b8