delete_0005fform_0002ejsp_jsp.java
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:4k
源码类别:
Jsp/Servlet
开发平台:
VBScript
- import java.sql.*;
- import javax.servlet.*;
- import javax.servlet.http.*;
- import javax.servlet.jsp.*;
- import org.apache.jasper.runtime.*;
- public class delete_0005fform_0002ejsp_jsp extends HttpJspBase {
- static {
- }
- public delete_0005fform_0002ejsp_jsp( ) {
- }
- private static boolean _jspx_inited = false;
- public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
- }
- public void _jspService(HttpServletRequest request, HttpServletResponse response)
- throws java.io.IOException, ServletException {
- JspFactory _jspxFactory = null;
- PageContext pageContext = null;
- HttpSession session = null;
- ServletContext application = null;
- ServletConfig config = null;
- JspWriter out = null;
- Object page = this;
- String _value = null;
- try {
- if (_jspx_inited == false) {
- synchronized (this) {
- if (_jspx_inited == false) {
- _jspx_init();
- _jspx_inited = true;
- }
- }
- }
- _jspxFactory = JspFactory.getDefaultFactory();
- response.setContentType("text/html; charset=GBK");
- pageContext = _jspxFactory.getPageContext(this, request, response,
- "", true, 8192, true);
- application = pageContext.getServletContext();
- config = pageContext.getServletConfig();
- session = pageContext.getSession();
- out = pageContext.getOut();
- // HTML // begin [file="/delete_form.jsp";from=(0,48);to=(1,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/delete_form.jsp";from=(1,29);to=(9,2)]
- out.write("rn<html>rn<head>rn<title>rndelete_formrn</title>rn</head>rn<body >rn ");
- // end
- // begin [file="/delete_form.jsp";from=(9,4);to=(39,0)]
- Connection conn = null;
- Statement stmt = null;
- ResultSet rs = null;
- try{
- Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
- }
- catch(ClassNotFoundException ce){
- out.println(ce.getMessage());
- }
- request.setCharacterEncoding("GBK");
- String str = request.getParameter("keywords");
- if( str == null)
- str = "";
- else
- try{
- conn=DriverManager.getConnection("jdbc:odbc:dsn112");
- stmt=conn.createStatement();
- rs=stmt.executeQuery("DELETE FROM Info WHERE stu_id LIKE '%" + str + "%'");
- }
- catch(SQLException e){
- System.out.println(e.getMessage());
- }
- finally{
- stmt.close();
- conn.close();
- }
- // end
- // HTML // begin [file="/delete_form.jsp";from=(39,2);to=(47,0)]
- out.write("rnrn<script language="JavaScript">rn ttalert("删除成功");rn ttlocation.href='delete.jsp'rn </script>rn</body>rn</html>rn");
- // end
- } catch (Throwable t) {
- if (out != null && out.getBufferSize() != 0)
- out.clearBuffer();
- if (pageContext != null) pageContext.handlePageException(t);
- } finally {
- if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
- }
- }
- }