delete.jsp
上传用户: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.*" %>
  6. <jsp:useBean id="a" scope="page" class="proj112.dbconn"/>
  7. <html>
  8. <body>
  9. <script language="JavaScript">
  10.          alert("确信要删除?");
  11.          history.back();
  12.    </script>
  13. <%
  14. request.setCharacterEncoding("GBK");
  15. String sql = null;
  16. try{
  17. String id2=request.getParameter("id");
  18. sql = "DELETE FROM  student WHERE stu_id='"+id2+"'";
  19. a.executeUpdate(sql);
  20. response.sendRedirect("std.jsp");
  21. }
  22. catch(Exception e){
  23. out.println("错误信息:"+e.getMessage());
  24. }
  25. %>
  26. </body>
  27. </html>