response.setContentType("text/html;charset=utf-8"); request.setCharacterEncoding("utf-8");
这两句话无论写什么关于servlet对数据库的操作,都要加上,一般就不会乱码了