javaWeb书店管理系统文档格式.docx

上传人:b****1 文档编号:1441453 上传时间:2023-04-30 格式:DOCX 页数:42 大小:174.98KB
下载 相关 举报
javaWeb书店管理系统文档格式.docx_第1页
第1页 / 共42页
javaWeb书店管理系统文档格式.docx_第2页
第2页 / 共42页
javaWeb书店管理系统文档格式.docx_第3页
第3页 / 共42页
javaWeb书店管理系统文档格式.docx_第4页
第4页 / 共42页
javaWeb书店管理系统文档格式.docx_第5页
第5页 / 共42页
javaWeb书店管理系统文档格式.docx_第6页
第6页 / 共42页
javaWeb书店管理系统文档格式.docx_第7页
第7页 / 共42页
javaWeb书店管理系统文档格式.docx_第8页
第8页 / 共42页
javaWeb书店管理系统文档格式.docx_第9页
第9页 / 共42页
javaWeb书店管理系统文档格式.docx_第10页
第10页 / 共42页
javaWeb书店管理系统文档格式.docx_第11页
第11页 / 共42页
javaWeb书店管理系统文档格式.docx_第12页
第12页 / 共42页
javaWeb书店管理系统文档格式.docx_第13页
第13页 / 共42页
javaWeb书店管理系统文档格式.docx_第14页
第14页 / 共42页
javaWeb书店管理系统文档格式.docx_第15页
第15页 / 共42页
javaWeb书店管理系统文档格式.docx_第16页
第16页 / 共42页
javaWeb书店管理系统文档格式.docx_第17页
第17页 / 共42页
javaWeb书店管理系统文档格式.docx_第18页
第18页 / 共42页
javaWeb书店管理系统文档格式.docx_第19页
第19页 / 共42页
javaWeb书店管理系统文档格式.docx_第20页
第20页 / 共42页
亲,该文档总共42页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

javaWeb书店管理系统文档格式.docx

《javaWeb书店管理系统文档格式.docx》由会员分享,可在线阅读,更多相关《javaWeb书店管理系统文档格式.docx(42页珍藏版)》请在冰点文库上搜索。

javaWeb书店管理系统文档格式.docx

}

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<

/reader.jsp"

).fo

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 人文社科 > 法律资料

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2