<property name="connection.url">
jdbc:mysql://localhost:3306/exam?characterEncoding=gb2312&useUnicode=true;
</property>
mysql中文乱码问题
有时候乱码问题不能光去找页面的问题,其实有很多地方都会出问题的.
1.最常见的方法是:IE浏览器-->查看-->编码--->unicode(UTF-8).这种方法能够处理一般的乱码问题.
2.还有一种是页面:
<%@ page contentType="text/html;charset=gb2312" %>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
3.
同时有针对MYSQL数据库输出的数据的乱码.
jdbc:mysql://localhost:3306/数据库名称?useUnicode=true&characterEncoding=GBK
4.补充一点:
从表单中获取数据 String name=new String(request.getParameter("name").getBytes("ISO8859_1"),"GBK");
这个也是一种解决方法....