delitem.jsp
上传用户:apbaoyuan
上传日期:2021-02-12
资源大小:1015k
文件大小:1k
源码类别:

Jsp/Servlet

开发平台:

HTML/CSS

  1. <%@page import="java.sql.*"%>
  2. <%@page import="java.util.*"%>
  3. <%@include file="opendata.jsp"%>
  4. <%@include file="check.jsp"%>
  5. <%
  6. try{
  7.  int itemid = Integer.parseInt(request.getParameter("itemid"));
  8.  //out.print(itemid);
  9.  int questionid = 0;
  10.  sql = "SELECT QuestionID from Items where ItemID ="+itemid;
  11.  rs = smt.executeQuery(sql);
  12.  while(rs.next())
  13.    questionid = rs.getInt(1);
  14.  
  15.  sql = "delete from Items where ItemID= "+itemid;
  16.  smt.executeUpdate(sql);
  17.  rs.close();
  18.  smt.close();
  19.  con.close();
  20.  
  21.  
  22.   
  23.  response.sendRedirect("edit.jsp?questionid="+questionid);
  24.  }
  25.  catch (Exception e) {
  26. e.getStackTrace();
  27. }
  28. %>