deluser.jsp

来自「大学JSP课程大作业」· JSP 代码 · 共 22 行

JSP
22
字号
<%@ page contentType="text/html; charset=gb2312"%>

<%@ page import="java.sql.*" %>
<%@ page import="my.shop.db.*" %>

<%-- 会话过滤 --%>
<%@ include file="sessionfilter.jsp" %>

<%
	String id = request.getParameter("id") ;
	String table = request.getParameter("table") ;
	String sql = "delete from "+table+" where id=?" ;
	Connection conn = DBConnection.getInstance().getConnection() ;
	PreparedStatement pstmt = conn.prepareStatement(sql) ;
	pstmt.setString(1,id) ;
	pstmt.executeUpdate() ;
	out.println("<div align='center'><font color=blue>指定用户成功删除!</font></div><br><a href='addadministrator.jsp'>返回</a>") ;
	pstmt.close() ;
	conn.close() ;
%>

⌨️ 快捷键说明

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