jsp页面中要做一些语言设置,比如:
<%@ page contentType="text/html;charset=GBK" language="java" %>
数据库连接的时候也要设置:
比如:
url = jdbc:mysql://localhost/test?user=root&password=123456&useUnicode=true&characterEncoding=GBK
<%@ page contentType="text/html;charset=GBK" language="java" %>
数据库连接的时候也要设置:
比如:
url = jdbc:mysql://localhost/test?user=root&password=123456&useUnicode=true&characterEncoding=GBK
在查询前先设置一下客户端的字符集
mysql>SET NAMES 'gbk';
再查询就OK了