delete_0005fform_0002ejsp_jsp.java
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:4k
源码类别:

Jsp/Servlet

开发平台:

VBScript

  1. import java.sql.*;
  2. import javax.servlet.*;
  3. import javax.servlet.http.*;
  4. import javax.servlet.jsp.*;
  5. import org.apache.jasper.runtime.*;
  6. public class delete_0005fform_0002ejsp_jsp extends HttpJspBase {
  7.     static {
  8.     }
  9.     public delete_0005fform_0002ejsp_jsp( ) {
  10.     }
  11.     private static boolean _jspx_inited = false;
  12.     public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
  13.     }
  14.     public void _jspService(HttpServletRequest request, HttpServletResponse  response)
  15.         throws java.io.IOException, ServletException {
  16.         JspFactory _jspxFactory = null;
  17.         PageContext pageContext = null;
  18.         HttpSession session = null;
  19.         ServletContext application = null;
  20.         ServletConfig config = null;
  21.         JspWriter out = null;
  22.         Object page = this;
  23.         String  _value = null;
  24.         try {
  25.             if (_jspx_inited == false) {
  26.                 synchronized (this) {
  27.                     if (_jspx_inited == false) {
  28.                         _jspx_init();
  29.                         _jspx_inited = true;
  30.                     }
  31.                 }
  32.             }
  33.             _jspxFactory = JspFactory.getDefaultFactory();
  34.             response.setContentType("text/html; charset=GBK");
  35.             pageContext = _jspxFactory.getPageContext(this, request, response,
  36.              "", true, 8192, true);
  37.             application = pageContext.getServletContext();
  38.             config = pageContext.getServletConfig();
  39.             session = pageContext.getSession();
  40.             out = pageContext.getOut();
  41.             // HTML // begin [file="/delete_form.jsp";from=(0,48);to=(1,0)]
  42.                 out.write("rn");
  43.             // end
  44.             // HTML // begin [file="/delete_form.jsp";from=(1,29);to=(9,2)]
  45.                 out.write("rn<html>rn<head>rn<title>rndelete_formrn</title>rn</head>rn<body >rn  ");
  46.             // end
  47.             // begin [file="/delete_form.jsp";from=(9,4);to=(39,0)]
  48.                 
  49.                 Connection conn = null;
  50.                 Statement stmt = null;
  51.                 ResultSet rs = null;
  52.                 try{
  53.                  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  54.                 }
  55.                 catch(ClassNotFoundException ce){
  56.                  out.println(ce.getMessage());
  57.                 }
  58.                 request.setCharacterEncoding("GBK");
  59.                 String str = request.getParameter("keywords");
  60.                 if( str == null)
  61.                  str = "";
  62.                       else
  63.                 try{
  64.                  conn=DriverManager.getConnection("jdbc:odbc:dsn112");
  65.                  stmt=conn.createStatement();
  66.                  rs=stmt.executeQuery("DELETE FROM Info WHERE stu_id LIKE '%" + str + "%'");
  67.                 
  68.                 
  69.                 }
  70.                 catch(SQLException e){
  71.                  System.out.println(e.getMessage());
  72.                 }
  73.                 finally{
  74.                  stmt.close();
  75.                  conn.close();
  76.                 }
  77.                 
  78.             // end
  79.             // HTML // begin [file="/delete_form.jsp";from=(39,2);to=(47,0)]
  80.                 out.write("rnrn<script language="JavaScript">rn        ttalert("删除成功");rn        ttlocation.href='delete.jsp'rn                 </script>rn</body>rn</html>rn");
  81.             // end
  82.         } catch (Throwable t) {
  83.             if (out != null && out.getBufferSize() != 0)
  84.                 out.clearBuffer();
  85.             if (pageContext != null) pageContext.handlePageException(t);
  86.         } finally {
  87.             if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
  88.         }
  89.     }
  90. }