spring boot 配置启动后执行sql, 中文乱码

spring.datasource.schema指定启动后执行的sql文件位置。

我发现中文乱码,原因是没有指定执行sql script encoding:

spring:
datasource:
url: "jdbc:h2:mem:test"
username: "sa"
password: ""
schema: database/import.sql
sql-script-encoding: utf-8
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: org.h2.Driver
maxActive: 20
initialSize: 1
maxWait: 60000
minIdle: 1
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: select 1
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
maxPoolPreparedStatementPerConnectionSize: 20
filters: stat

 

So do it,and change it,no regret!
http://www.cnblogs.com/woshimrf/p/5625474.html
上一篇:linux fedora查看RPM包更新日志,yum查看rpm包changelog插件


下一篇:SpringCloud中文社区转型Spring4All欢迎您的加入