jsp查询数据如何在网页显示
数据库字段
username dw xl nl
张三 税务局 研究生 30
现在jaca文件从网页文本框获取username字段 我只弄明白一个删除,修改和添加功能,请问查询应该如何做
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
db aa=new db();
try{
Statement stmt=aa.getConn().createStatement();
stmt.executeUpdate("delete from test where usnamename='"+request.getSession().getAttribute("name")+"'");
}
catch(Exception e){
System.out.print(e);
}
}