javaWeb书店管理系统方案Word文件下载.docx
- 文档编号:17806476
- 上传时间:2022-12-10
- 格式:DOCX
- 页数:35
- 大小:174.84KB
javaWeb书店管理系统方案Word文件下载.docx
《javaWeb书店管理系统方案Word文件下载.docx》由会员分享,可在线阅读,更多相关《javaWeb书店管理系统方案Word文件下载.docx(35页珍藏版)》请在冰豆网上搜索。
}
body,table,th,td,input,select,textarea{
font-family:
Tahoma,Verdana,Arial,Helvetica,sans-serif;
font-size:
12px;
table.default{
border:
1pxsolid#3366CC;
border-collapse:
collapse;
width:
80%;
table.defaulttd{
padding:
2525;
height:
26px;
text-align:
center;
1pxsolid#ffffff;
background-color:
#f0f0f0;
table.defaulttr.titletd{
font-weight:
bold;
#99CCFF;
color:
red;
white-space:
nowrap;
table.defaultth.item{
#333333;
vertical-align:
top;
10px;
14px;
xyh.css:
body{font-family:
Arial,Helvetica,sans-serif;
12px;
color:
#666666;
background:
#fff;
center;
*{margin:
0;
padding:
a{color:
#1E7ACE;
text-decoration:
none;
}
a:
hover{color:
#000;
underline;
h3{font-size:
14px;
font-weight:
bold;
pre,p{color:
margin:
4px;
input,select,textarea{padding:
1px;
2px;
font-size:
11px;
.buttom{padding:
1px10px;
1px#1E7ACEsolid;
#D0F0FF;
#formwrapper{width:
450px;
15pxauto;
20px;
text-align:
left;
border:
1pxsolid#A4CDF2;
fieldset{padding:
10px;
margin-top:
5px;
fieldsetlegend{color:
3px20px3px20px;
fieldsetlabel{float:
width:
120px;
right;
fieldsetdiv{clear:
margin-bottom:
.input{width:
.enter{text-align:
.clear{clear:
both;
Common.js:
functionisNum(num){
for(i=0;
i<
num.length;
i++)
{
c=num.charAt(i);
if(c>
'
9'
||c<
0'
){
returnfalse;
returntrue;
functioncheck(){
if(form1.id.value=="
"
)
{alert("
noid!
);
form1.id.focus();
if(form1.name.value=="
{alert("
noname!
form1.name.focus();
if(form1.author.value=="
alert("
noauthor!
form1.author.focus();
if(form1.press.value=="
nopress!
form1.press.focus();
if(form1.date.value=="
nodate!
form1.date.focus();
if(!
isNum(form1.price)){
priceiswrong!
form1.price.focus();
isNum(form1.account)){
accountiswring!
form1.account.focus();
Bookinfo.java:
packagebean;
importjava.lang.String;
importjava.lang.System;
importjava.sql.ResultSet;
importjava.sql.SQLException;
importjava.util.ArrayList;
publicclassbookinfo{
privateStringid;
privateStringname;
privateStringauthor;
privateStringpress;
privateStringdate;
privateintprice;
privateintaccount;
publicvoidsetName(Stringname){
this.name=name;
publicStringgetName(){
returnname;
publicvoidsetAuthor(Stringauthor){
this.author=author;
publicStringgetAuthor(){
returnauthor;
publicvoidsetDate(Stringdate){
this.date=date;
publicStringgetDate(){
returndate;
publicvoidsetPress(Stringpress){
this.press=press;
publicStringgetPress(){
returnpress;
publicvoidsetId(Stringid){
this.id=id;
publicStringgetId(){
returnid;
publicvoidsetAccount(intacount){
this.account=acount;
publicintgetAccount(){
returnaccount;
publicvoidsetPrice(intprice){
this.price=price;
publicintgetPrice(){
returnprice;
publicstaticArrayList<
bookinfo>
getbooklist(){
ArrayList<
list=newArrayList<
();
Stringsql="
select*frombook.bookshop"
;
dbbeanjdbc=newdbbean();
ResultSetrs=jdbc.executeQuery(sql);
try{
while(rs.next()){
bookinfobi=newbookinfo();
bi.setId(rs.getString("
id"
));
bi.setName(rs.getString("
name"
bi.setAuthor(rs.getString("
author"
bi.setPress(rs.getString("
press"
bi.setDate(rs.getString("
date"
bi.setPrice(rs.getInt("
price"
bi.setAccount(rs.getInt("
account"
list.add(bi);
rs.close();
catch(SQLExceptione){
e.printStackTrace();
jdbc.close();
returnlist;
//通过编号书名作者来搜索
getbookbyway(Stringid,Stringname,Stringauthor){
Stringsql=null;
intway=0;
if(!
id.equals("
)){way=way+1;
name.equals("
)){way=way+10;
author.equals("
)){way=way+100;
if(way==1||way==11||way==101){
sql="
select*frombook.bookshopwhereid='
+id+"
if(way==10){
select*frombook.bookshopwherenamelike'
%"
+name+"
%'
if(way==100){
select*frombookshopwhereauthorlike'
+author+"
if(way==110){
select*frombookshopwherenamelike'
andauthorlike'
System.out.println("
nofind"
publicstaticbookinfogetbookbyid(Stringid){
bookinfobi=newbookinfo();
if(rs.next()){
returnbi;
publicstaticintupdatebook(Stringid,Stringname,Stringauthor,Stringpress,Stringdate,intprice,intaccount){
intresult=0;
updatebook.bookshopsetname='
author='
press='
+press+"
date='
+date+"
price="
+price+"
account="
+account+"
whereid='
result=jdbc.executeUpdate(sql);
returnresult;
publicstaticintdeletebook(Stringid){
deletefrombook.bookshopwhereid='
publicstaticintaddbook(Stringid,Stringname,Stringauthor,Stringpress,Stringdate,intprice,intaccount){
insertintobook.bookshop(id,name,author,press,date,price,account)values('
'
"
)"
Dbbean.java:
importjava.lang.*;
importjava.sql.*;
publicclassdbbean{
privateStringdriverStr="
com.mysql.jdbc.Driver"
privateStringconnStr="
jdbc:
mysql:
//localhost:
3306/book?
characterEncoding=utf-8"
privateStringname="
root"
privateStringpassword="
xyh201268"
privateConnectionconn=null;
privateStatementstmt=null;
publicdbbean(){
Class.forName(driverStr);
conn=DriverManager.getConnection(connStr,name,password);
stmt=conn.createStatement();
catch(Exceptionex){
connecttodatabaseisworry!
publicintexecuteUpdate(Strings){
result=stmt.executeUpdate(s);
updatewrong!
publicResultSetexecuteQuery(Strings){
ResultSetrs=null;
rs=stmt.executeQuery(s);
searchwrong!
returnrs;
publicvoidclose(){
try{stmt.close();
conn.close();
cannotclosethedatabase!
Servlet.java:
packageservlets;
importjavax.servlet.ServletException;
importjavax.servlet.http.HttpServlet;
importjavax.servlet.http.HttpServletRequest;
importjavax.servlet.http.HttpServletResponse;
importjava.io.IOException;
/**
*CreatedbyAdministratoron14-5-31.
*/
publicclassServletextendsHttpServlet{
protectedvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{
doPost(request,response);
protectedvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{
request.setCharacterEncoding("
utf-8"
Stringaction=request.getServletPath();
if(action.equals("
/servlets/depend.do"
)){
Stringvalue=request.getParameter("
password"
if(value.equals("
123"
bean.bookinfo>
list=bean.bookinfo.getbooklist();
request.setAttribute("
list"
list);
request.getRequestDispatcher("
/manager.jsp"
).forward(request,response);
else
{ArrayList<
/r
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- javaWeb 书店 管理 系统 方案