问题:
通过中文查询时得到的结果集为0,这主要是编码的问题
解决方法:
可以在连接mysql数据库时在连接字符串中进行设置如:
url="jdbc:mysql://localhost:3306/db_pos?useUnicode=true&characterEncoding=utf8"
这样就可以了
参考:
本文共 168 字,大约阅读时间需要 1 分钟。
问题:
通过中文查询时得到的结果集为0,这主要是编码的问题
解决方法:
可以在连接mysql数据库时在连接字符串中进行设置如:
url="jdbc:mysql://localhost:3306/db_pos?useUnicode=true&characterEncoding=utf8"
这样就可以了
参考:
转载地址:http://ochel.baihongyu.com/