代码如下:
public String Query(HttpServletRequest request){
String html="";
try {
request.setCharacterEncoding("UTF-8");
} catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
String type=request.getParameter("type");
String content=request.getParameter("content");
String sql="select * from tellist where '"+type+"'='"+content+"'";
try{
Statement pstmt=con.createStatement();
ResultSet rs1=pstmt.executeQuery(sql);
html+="
id</ | 姓名 | 性别 | 年龄 | 电话 | 邮箱 | 住址 |