资源描述
jsp实现网上书店的后台部分.docx
《jsp实现网上书店的后台部分.docx》由会员分享,可在线阅读,更多相关《jsp实现网上书店的后台部分.docx(19页珍藏版)》请在冰豆网上搜索。
jsp实现网上书店的后台部分
Bookadd.jsp
<%@pagecontentType="text/html;charset=gb2312"language="java"import="java.sql.*"errorPage=""%>
<%@pageimport="java.util.*"%>
useBeanid="db"class="JavaBean.myDb"/>
<%
Stringpath=request.getContextPath();
StringbasePath=request.getScheme()+":
//"+request.getServerName()+":
"+request.getServerPort()+path+"/";
%>
DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN">
">
MyJSP'bookManager.jsp'startingpage
--
-->
--
body{
background-image:
url(image/18.jpg);
}
-->
图书ID
|
图书名称 | |
作者 | |
出版社 | |
类别 | 科技 艺术 生活 社会 娱乐 教育 |
价格 | |
库存 | |
|
<%
StringbookId=request.getParameter("bookid");
Stringbookname=request.getParameter("bookname");
Stringauthor=request.getParameter("author");
Stringpublisher=request.getParameter("publisher");
Stringcategory=request.getParameter("category");
Stringprice=request.getParameter("price");
Stringstock=request.getParameter("stock");
if(bookId!
=null&&bookname!
=null&&publisher!
=null&&category!
=null&&price!
=null&&stock!
=null){
Stringrssql="insertintobookvalues('"+bookId+"','"+bookname+"','"+author+"','"+publisher+"','"+category+"','"+price+"','"+stock+"')";
db.connection();
intrsn=db.update(rssql);
out.print(rssql);
//if(rsn>0){
//response.sendRedirect("Admin/bookadd.jsp");
//}
}
%>
Bookdelete.jsp
<%@pagecontentType="text/html;charset=gb2312"language="java"import="java.sql.*"errorPage=""%>
<%@pageimport="java.util.*"%>
useBeanid="db"class="JavaBean.myDb"/>
<%
Stringpath=request.getContextPath();
StringbasePath=request.getScheme()+":
//"+request.getServerName()+":
"+request.getServerPort()+path+"/";
%>
DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN">
">
MyJSP'bookManager.jsp'startingpage
--
-->
--
body{
background-image:
url(image/18.jpg);
}
-->
图书ID
图书名称
作者
出版社
类别
价格
库存
|
<%
ResultSetrs=null;
db.connection();
Stringquery="select*frombook";
rs=db.query(query);
while(rs.next())
{Strings1=rs.getString
(1);
Strings2=rs.getString
(2);
Strings3=rs.getString(3);
Strings4=rs.getString(4);
Strings5=rs.getString(5);
Strings6=rs.getString(6);
Strings7=rs.getString(7);
%>
<%=s1%> | <%=s2%> | <%=s3%> | <%=s4%> | <%=s5%> | <%=s6%> | <%=s7%> | id=<%=s1%>"onClick="confirm('真的要删除吗? ');">删除 |
<%
}
%>
<%@pagecontentType="text/html;charset=gb2312"language="java"import="java.sql.*"errorPage=""%>
<%@pagecontentType="text/html;charset=gb2312"language="java"import="java.sql.*"errorPage=""%>