?? admin_processproduct.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 + -