jdbc:mysql://localhost:3306/xxxx?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowMultiQueries=true
相关参数:
useUnicode=true
是否使用Unicode字符集,如果参数characterEncoding设置为gb2312或gbk,本参数值必须设置为true
characterEncoding=utf8 当useUnicode设置为true时,指定字符编码。比如可设置为gb2312或gbk
zeroDateTimeBehavior=convertToNull timestamp(时间值) 没有正确数据为了防止抛出异常使用
1.exception (不指定,则默认)默认抛出异常,
2.convertToNull 转化为null
3.round 替换成最近的日期即XXXX-01-01
serverTimezone=GMT%2B8 时区
1.UTC 世界统一时间 比北京时间早八小时
2.GMT%2B8 北京时间
3.Asia/Shanghai 上海时间
allowMultiQueries=true
1.可以在sql语句后携带分号,实现多语句执行。
2.可以执行批处理,同时发出多个SQL语句。