解决方案:在原有连接MySQL数据库的代码基础上添加:?useUnicode=true&characterEncoding=utf-8

原本:

Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/test", "root", "123456");

修改之后:

Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=utf-8", "root", "123456");

  

相关文章:

  • 2022-12-23
  • 2021-07-01
  • 2021-10-07
  • 2022-12-23
  • 2021-11-15
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
猜你喜欢
  • 2019-03-27
  • 2021-08-07
  • 2021-09-09
  • 2021-10-27
  • 2021-11-27
  • 2021-08-26
  • 2021-04-14
相关资源
相似解决方案