jdbc URL中的各个参数详解

 

mysql JDBC URL格式如下:

 

jdbc:mysql://[host:port],[host:port].../[database][?参数名1][=参数值1][&参数名2][=参数值2]...

 

通常mysql连接URL可以设置为:

jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&failOverReadOnly=false

 

可以直接在数据库连接地址的数据库名称后面加 ?characterEncoding=utf-8

 

参考链接:https://www.cnblogs.com/Im-Victor/p/11075716.html

 
posted @ 2020-05-09 16:06  Y鱼鱼鱼Y  阅读(2004)  评论(0)    收藏  举报