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

问题

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

解决方法:

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

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

  这样就可以了

posted @ 2016-05-13 13:35  罗锐原  阅读(309)  评论(0编辑  收藏  举报