⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drop.jsp

📁 一个bug管理系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java"
	import="java.sql.*" errorPage=""%>
<%
	String pass = null;
	pass = (String) session.getAttribute("pass");
	if ("y".equals(pass)) {
		String id = request.getParameter("id");

		if (id == null) {
			out.print("<h3><font color=#FF0000>ERROR!</font></h3>");
		} else {
			String host = "localhost";
			String user = "root";
			String pw = "123";
			String db = "numb1";

			Class.forName("com.mysql.jdbc.Driver").newInstance();
			String url = "jdbc:mysql://" + host + "/" + db;
			Connection con = DriverManager.getConnection(url, user, pw);
			java.sql.Statement st = con.createStatement();

			String sql = "delete from lyb where id=" + id;
			st.executeUpdate(sql);
			st.close();
			con.close();
			response.sendRedirect("index.jsp");
		}
	} else {
		response.sendRedirect("log.jsp");
	}
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -