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

出现中文变问号的代码:

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

解决方法:

String url = "jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8";
发布了45 篇原创文章 · 获赞 1 · 访问量 5219

猜你喜欢

转载自blog.csdn.net/weixin_42814000/article/details/104559836