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

📄 user_delete.jsp

📁 一个JSP范例
💻 JSP
字号:
	<%@page contentType="text/html;charset=Gb2312" 
	  import="java.sql.*,java.util.Date,com.PoolBean"%>
	<JSP:useBean id="pool" scope="application" class="com.PoolBean"/>
	<%
	String strLoginUser = (String)session.getAttribute("LoginUser");
	if (strLoginUser == null || strLoginUser.length() == 0)	
		response.sendRedirect("Login.jsp");	
	%>
	<html>
	<head>
	  <title><h1>用户删除</h1></title>
	</head>
	<body>
	<center>
	 <font size=5 color=blue></font>用户删除</font>
	</center>
	<hr>
	<%
	try
	  {   com.PoolBean pool = new com.PoolBean();
	 	if (pool.getConnectionSize() == 0)
		{
			pool.initializePool();
		}	
		Connection con = null;
		Statement stmt = null;
		con = pool.getConnection();
		stmt= con.createStatement();
		String strDel ="delete from user where code='"+strLoginUser+"'";	
		stmt.executeUpdate(strDel);
		stmt.close();//关闭Statement对象
		pool.releaseConnection(con);
		response.sendRedirect("Login.jsp");
	  }
	   catch (Exception e)
	  {
	     out.println(e.getMessage());
	  }
	 %>
	</body>
	</html>

⌨️ 快捷键说明

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