linux下mysql中文查询得不到结果

问题

  通过中文查询时得到的结果集为0,这主要是编码的问题

解决方法:

   可以在连接mysql数据库时在连接字符串中进行设置如:

      url="jdbc:mysql://localhost:3306/db_pos?useUnicode=true&characterEncoding=utf8"

  这样就可以了

参考:http://hbyxfy.iteye.com/blog/505826

原文地址:https://www.cnblogs.com/lpshou/p/2797156.html