【JSP开源代码栏目提醒】:以下是网学会员为您推荐的JSP开源代码-execu_order.jsp,希望本篇文章对您学习有所帮助。
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="connManager" scope="application" class="com.ConnManager" />
<%
String UserName=session.getValue("UserName");
if (UserName==null)
response.sendRedirect("login.jsp");
Connection con = connManager.getConnection("mysql");
if(con==null)
{
%>对不起,现在数据库忙,请稍后再试<%
}
Statement stmt = con.createStatement();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<%
String execu=request.getParameter("execu");
String SortId=request.getParameter("sortid");
String sql="";
if(execu==null){
sql="update order_detail set sell='"+0+"' where Sub='"+SortId+"'";
}else if(execu.equals("on")){
sql="update order_detail set sell='"+1+"' where Sub='"+SortId+"'";
}
int temp=stmt.executeUpdate(sql);
if(temp>0){
response.sendRedirect("manage_order.jsp");
}else{
%>
<script language="javascript">
alert("数据库发生错误");
history.back();
</script>
<%
}
rs.close();
stmt.close();
connManager.releaseConnection("cart",con);
%>
</body>
</html>
上一篇:
exception_test.jsp
下一篇:
试题库管理系统毕业论文