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

📄 admin_processproduct.jsp

📁 Easy_Buy是一个在线销售系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="pool" scope="application" class="PoolBean"/>
<html>
<head>
<title>正在处理,请稍后......</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<center>
  正在处理,请稍后...... 
<%
	String p_name=new String(request.getParameter("ProductName").getBytes("8859_1"));
	String p_code=new String(request.getParameter("Coding").getBytes("8859_1"));
	
	Connection conn=pool.getConnection();
	Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);  
	String sql1="SELECT * FROM Products WHERE ProductName='"+p_name+"'"; 
	ResultSet rsProduct=stmt.executeQuery(sql1);

	if(rsProduct.next()){ 
		response.sendRedirect("admin_loginFailure.jsp");
		}	
	else{
		String sql2="INSERT INTO Products(ProductName,Coding) VALUES('"+p_name+"','"+p_code+"')"; 
		stmt.executeUpdate(sql2);
		response.sendRedirect("admin_index.jsp");
	}
	stmt.close();
	pool.releaseConnection(conn);
%>
</center>
</body>
</html>

⌨️ 快捷键说明

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