delete.jsp~36~
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:1k
源码类别:

Jsp/Servlet

开发平台:

VBScript

  1. <%@ page contentType="text/html; charset=GBK" %>
  2. <%@ page import="java.sql.*" %>
  3. <%@ page language="java" %>
  4. <%@ page import="java.util.*" %>
  5. <%@ page import="proj112.DataFormat" %>
  6. <%@ page import="proj112.*" %>
  7. <jsp:useBean id="a" scope="page" class="proj112.dbconn"/>
  8. <html>
  9. <body>
  10. <%
  11. request.setCharacterEncoding("GBK");
  12. String sql = null;
  13. try{
  14. String id2=request.getParameter("id");
  15. sql = "DELETE FROM  student WHERE stu_name='"+id2+"'";
  16. a.executeUpdate(sql);
  17. response.sendRedirect("std.jsp");
  18. }
  19. catch(Exception e){
  20. out.println("错误信息:"+e.getMessage());
  21. }
  22. %>
  23. </body>
  24. </html>