JDBC插入数据时中文变为问号的解决方法

JDBC插入数据时中文变为问号的解决方法

制作人:全心全意

 

出现中文变问号的代码:

String url = "jdbc:mysql://localhost:3306/test";

  

解决方法:

String url = "jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8";

 

posted @ 2018-10-18 17:47  全心全意_运维  阅读(1291)  评论(0编辑  收藏  举报