============问题描述============
if (sqlConn.executeQuery("select * from user_test where name =‘" + username + "‘and password =‘" + password + "‘") != null) { resp.setContentType("text/xml; charset=UTF-8"); PrintWriter out = resp.getWriter(); out.print("用户" + username + "登陆成功"); out.flush(); out.close(); } else { resp.setContentType("text/xml; charset=UTF-8"); PrintWriter out = resp.getWriter(); out.print("用户名或密码不正确"); out.flush(); out.close(); }
============解决方案1============
原文:http://www.cnblogs.com/yiguobei99/p/4041851.html