delete_form.jsp~1~
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:1k
源码类别:
Jsp/Servlet
开发平台:
VBScript
- <%@ page contentType="text/html; charset=GBK" %>
- <%@page import="java.sql.*"%>
- <html>
- <head>
- <title>
- delete_form
- </title>
- </head>
- <body background="img/bgg.jpg">
- <%
- 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:dsn069");
- stmt=conn.createStatement();
- rs=stmt.executeQuery("DELETE FROM Infor WHERE name LIKE '%" + str + "%'");
- }
- catch(SQLException e){
- System.out.println(e.getMessage());
- }
- finally{
- stmt.close();
- conn.close();
- }
- %>
- <script language="JavaScript">
- alert("删除成功");
- location.href='delete.jsp'
- </script>
- </body>
- </html>