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

📄 tianjiahou.jsp

📁 图书管理系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@include file="inc/conn.jsp"%>
<%  
   //解决中文乱码问题
   response.setContentType("text/html;CharSet=gb2312");
   request.setCharacterEncoding("gb2312");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>添加后</title>
</head>

<body>
<%
String sql;
String ID=request.getParameter("ID").trim();
String BOOK_NAME=request.getParameter("BOOK_NAME").trim();
//BOOK_NAME=new String(BOOK_NAME.getBytes("ISO-8859-1"));
String BOOK_ID=request.getParameter("BOOK_ID").trim();
String BOOK_STYLE=request.getParameter("BOOK_STYLE").trim();
//BOOK_STYLE=new String(BOOK_STYLE.getBytes("ISO-8859-1"));
String BOOK_CBS=request.getParameter("BOOK_CBS").trim();
//BOOK_CBS=new String(BOOK_CBS.getBytes("ISO-8859-1"));
String BOOK_PRICE=request.getParameter("BOOK_PRICE").trim();
String BOOK_DATE=request.getParameter("BOOK_DATE").trim();
String BOOK_COUNT=request.getParameter("BOOK_COUNT").trim();

//有效性判断

if(BOOK_NAME.equals("")){
response.sendRedirect("cuowu.jsp");
}
if(BOOK_ID.equals("")){
response.sendRedirect("cuowu.jsp");
}
/*
if(ID.length()!=4){
response.sendRedirect("cuowu.jsp");
}
sql="select * from tushubiao where ID='"+ID+"'";
int rs=stmt.executeUpdate(sql); 
if(rs.getRow()>0){
response.sendRedirect("cuowu.jsp");
}
*/
sql = "insert into tushubiao ";
sql=sql+"values("+ID+",'"+BOOK_NAME+"','"+BOOK_ID+"','"+BOOK_STYLE+"','"+BOOK_CBS+"',"+BOOK_PRICE+",'"+BOOK_DATE+"',"+BOOK_COUNT+")";

mt.executeUpdate(sql); 
%>
<!--转向到图书查询页-->
<script language="javascript">
 location.href="chaxunhou.jsp";
</script>
</body>

</html>

⌨️ 快捷键说明

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