jsp202電影票預(yù)定系統(tǒng)(ssh)-qkrp_第1頁(yè)
jsp202電影票預(yù)定系統(tǒng)(ssh)-qkrp_第2頁(yè)
jsp202電影票預(yù)定系統(tǒng)(ssh)-qkrp_第3頁(yè)
jsp202電影票預(yù)定系統(tǒng)(ssh)-qkrp_第4頁(yè)
jsp202電影票預(yù)定系統(tǒng)(ssh)-qkrp_第5頁(yè)
已閱讀5頁(yè),還剩135頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

經(jīng)過(guò)4個(gè)月的不懈努力,和指導(dǎo)老師的諄諄教導(dǎo),以及同組同學(xué)的團(tuán)結(jié)協(xié)作,充分利用大學(xué)四年所學(xué)的專業(yè)知識(shí),通過(guò)大量閱讀與設(shè)計(jì)相關(guān)的專業(yè)參考文獻(xiàn),我終于完成了本次畢業(yè)設(shè)計(jì),已經(jīng)基本上實(shí)現(xiàn)了電影票預(yù)訂系統(tǒng)的各項(xiàng)功能。在這次畢業(yè)設(shè)計(jì)過(guò)程中,我獨(dú)立設(shè)計(jì)和實(shí)現(xiàn)了用戶注冊(cè),用戶登錄,修改密碼,留電影瀏覽等幾個(gè)模塊的全部功能,以及這幾個(gè)模塊的數(shù)據(jù)庫(kù)設(shè)計(jì)。通過(guò)這次畢業(yè)設(shè)計(jì),我掌握了SQLServer2000這種大型數(shù)據(jù)庫(kù)的編程方法,掌握了JAVA語(yǔ)言和JSP技術(shù)。了解到電子商務(wù)的理論以及平臺(tái)開(kāi)發(fā)的模式,掌握了網(wǎng)絡(luò)開(kāi)發(fā)的方法與模式。對(duì)團(tuán)隊(duì)的協(xié)作,對(duì)軟件開(kāi)發(fā)方法和手段,有了一定的認(rèn)識(shí),豐富了我的軟件開(kāi)發(fā)的經(jīng)驗(yàn),提高了程序編寫(xiě)的水平,并加深理解了許多課程中、書(shū)本上學(xué)到的知識(shí)和理論。同時(shí),通過(guò)編寫(xiě)畢業(yè)設(shè)計(jì)論文,我還基本掌握了軟件文檔的書(shū)寫(xiě)方法和書(shū)寫(xiě)格式。本系統(tǒng)盡管有自己的特色,但缺陷也是明顯的,如安全性,效率問(wèn)題等等。由于時(shí)間,能力,國(guó)內(nèi)JAVA,JSP技術(shù)資料有限等原因,有些功能實(shí)現(xiàn)的并不完美,在已經(jīng)完成的程序中,也存在許多不盡人意的算法,也沒(méi)有統(tǒng)一優(yōu)化,系統(tǒng)有待進(jìn)一步改善,而這些問(wèn)題也讓我充分認(rèn)識(shí)到了軟件開(kāi)發(fā)的困難。通過(guò)畢業(yè)設(shè)計(jì),我學(xué)會(huì)了如何去了解一種新型的技術(shù),去掌握一種技術(shù)。以及軟件開(kāi)發(fā)的基本流程。在學(xué)習(xí)過(guò)程中,我們遇到問(wèn)題經(jīng)常上網(wǎng)求助,去書(shū)店查詢資料,擴(kuò)大了自己的知識(shí)面。總之,這次畢業(yè)設(shè)計(jì)為我今后繼續(xù)學(xué)習(xí)、深造奠定了基礎(chǔ),我非常感謝各位老師、同學(xué)的支持與幫助。致謝在本次畢業(yè)設(shè)計(jì)過(guò)程中,得到了指導(dǎo)老師的指導(dǎo)與支持。在此特別感謝我的指導(dǎo)老師。指導(dǎo)老師的細(xì)心指導(dǎo)和大力支持,在總體結(jié)構(gòu)、功能的把握上給予了非常大的幫助,同時(shí)跟我提供了非常優(yōu)越的設(shè)計(jì)環(huán)境,并對(duì)我在編程、數(shù)據(jù)庫(kù)設(shè)計(jì)等細(xì)節(jié)工作上給予了耐心的指導(dǎo),對(duì)于我順利完成這次畢業(yè)設(shè)計(jì)起到了關(guān)鍵性的作用。我還要感謝我的母?!筮B交通大學(xué)軟件學(xué)院,以及在大學(xué)五年生活中給予我關(guān)心和幫助的老師和同學(xué),是他們教會(huì)了我專業(yè)的知識(shí)和做人的道理。通過(guò)這次畢業(yè)設(shè)計(jì)我還明白了作為一名計(jì)算機(jī)專業(yè)的大學(xué)畢業(yè)生,我們要會(huì)的不僅僅是編寫(xiě)代碼,更重要的是要有整體把握系統(tǒng)設(shè)計(jì)的能力。我會(huì)在以后的工作和學(xué)習(xí)中不斷完善自己,為我最熱愛(ài)的母校爭(zhēng)光,為自己翻開(kāi)輝煌的新篇章。參考文獻(xiàn)[1]羅漢祥.B2B電子商務(wù)模式分析與思考[J].商業(yè)研究,2004.[2]丁長(zhǎng)名、石靜、趙澤宇.Web服務(wù)研究綜述.計(jì)算機(jī)科學(xué),2003.[4]岳昆、王曉玲、周傲英.Web服務(wù)核心支撐技術(shù):研究綜述.軟件學(xué)報(bào),2004.[4]張貴明.網(wǎng)站與網(wǎng)頁(yè)設(shè)計(jì)[M].北京:清華大學(xué)出版社,2007.[5]布雷恩.萊特著趙明昌譯.JSP數(shù)據(jù)庫(kù)編程指南[M].北京:希望電子出版社,2001.[6]徐國(guó)志,汪孝宜等.SQLServer數(shù)據(jù)庫(kù)開(kāi)發(fā)實(shí)例精粹[M].北京:電子工業(yè)出版社,2006.[7]張銀鶴,劉治國(guó),張豪等.JSP動(dòng)態(tài)網(wǎng)站開(kāi)發(fā)實(shí)踐教程[M].北京:清華大學(xué)社,2007.[8]張海藩.軟件工程[M].人民郵電出版社,2002.[9]Stephenwynkoop.SQLServer7.0開(kāi)發(fā)指南[J].北京:電子工業(yè)出版社,1999.[10]蔡劍,景楠.JavaWeb應(yīng)用開(kāi)發(fā)J2EE和Tomcat[M].北京:清華大學(xué)出版社,2005.[11]孫衛(wèi)琴.精通Struts:基于MVC的JavaWeb設(shè)計(jì)與開(kāi)發(fā)[M].北京:電子工業(yè)出版社,2004.[12]PaulSimith.DatabaseAppliction[J].北京:電子工業(yè)出版社,2001.附錄源代碼packagebean;importjava.sql.Connection;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.util.ArrayList;importutil.DBConn;publicclassAdminLoginBean{ Connectionconn=null; Statementst=null; ResultSetrs=null; ArrayListal=newArrayList(); publicintlogin(Stringname,Stringpwd){ inttemp=0; conn=DBConn.getConn(); try{ st=conn.createStatement(); rs=st.executeQuery("select*fromadminwherename='"+name+"'"); if(rs.next()){ Stringid=rs.getString("id"); Stringtname=rs.getString("name"); Stringtpwd=rs.getString("pwd"); if(pwd.equals(tpwd)){ temp=1; al.add(id); al.add(tname); al.add(tpwd); }else{ temp=2; } }else{ temp=3; } }catch(SQLExceptione){ e.printStackTrace(); }finally{ DBConn.close(conn,st,rs); } returntemp; } publicArrayListgetArrayLst(){ returnal; }}packagebean;importjava.sql.Connection;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.util.ArrayList;importutil.DBConn;publicclassInsertUpdateDelBean{ Connectionconn=null; Statementst=null; ResultSetrs=null; publicintinsertANDupdateANDdel(Stringsql){ inttemp=0; conn=DBConn.getConn(); try{ st=conn.createStatement(); temp=st.executeUpdate(sql); }catch(SQLExceptione){ //TODO自動(dòng)生成catch塊 e.printStackTrace(); temp=-1; }finally{ DBConn.close(conn,st,rs); } returntemp; }}packagebean;importjava.sql.Connection;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.util.ArrayList;importutil.DBConn;publicclassReckoningBean{ Connectionconn=null; Statementst=null; ResultSetrs=null; BooleanautoCommit=false; inttemp=0; publicintinsert(ArrayListal,Stringid){ inti=0; conn=DBConn.getConn(); try{ autoCommit=conn.getAutoCommit(); conn.setAutoCommit(false); st=conn.createStatement(); for(i=0;i<al.size();i++){ ArrayListalRow=(ArrayList)al.get(i); st.executeUpdate("updatebookssetstorage=storage-"+alRow.get(3)+",sums=sums+"+alRow.get(3)+"whereid='"+alRow.get(0)+"'"); st.executeUpdate("insertintoorders(userid,bookid,booksum)values('"+id+"','"+alRow.get(0)+"','"+alRow.get(3)+"')"); rs=st.executeQuery("select*frompaihangwherename='"+alRow.get(1)+"'"); if(rs.next()){ st.executeUpdate("deletefrompaihangwherename='"+alRow.get(1)+"'"); st.executeUpdate("insertintopaihang(bookid,name)values('"+alRow.get(0)+"','"+alRow.get(1)+"')"); }else{ st.executeUpdate("insertintopaihang(bookid,name)values('"+alRow.get(0)+"','"+alRow.get(1)+"')"); } } if(i==al.size()){ mit(); } }catch(SQLExceptione){ //TODO自動(dòng)生成catch塊 try{ conn.rollback(); }catch(SQLExceptione1){ //TODO自動(dòng)生成catch塊 e1.printStackTrace(); } e.printStackTrace(); temp=-1; }finally{ try{ conn.setAutoCommit(autoCommit); }catch(SQLExceptione){ //TODO自動(dòng)生成catch塊 e.printStackTrace(); } DBConn.close(conn,st,rs); } returntemp; }}packagebean;importjava.sql.Connection;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.util.ArrayList;importutil.DBConn;publicclassSelectBean{ Connectionconn=null; Statementst=null; ResultSetrs=null; publicArrayListselect(Stringsql,String[]args){ ArrayListal=newArrayList(); conn=DBConn.getConn(); try{ st=conn.createStatement(); rs=st.executeQuery(sql); while(rs.next()){ ArrayListalRow=newArrayList(); for(inti=0;i<args.length;i++){ alRow.add(rs.getString(args[i])); } al.add(alRow); } }catch(SQLExceptione){ //TODO自動(dòng)生成catch塊 e.printStackTrace(); }finally{ DBConn.close(conn,st,rs); } returnal; }}packagebean;importjava.sql.Connection;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;importjava.util.*;importutil.*;publicclassUserLoginBean{ Connectionconn=null; Statementst=null; ResultSetrs=null; ArrayListal=newArrayList(); publicintlogin(Stringname,Stringpwd){ inttemp=0; conn=DBConn.getConn(); try{ st=conn.createStatement(); rs=st.executeQuery("select*fromuserswherename='"+name+"'"); if(rs.next()){ Stringid=rs.getString("id"); Stringtname=rs.getString("name"); Stringtpwd=rs.getString("pwd"); if(pwd.equals(tpwd)){ temp=1; al.add(id); al.add(tname); al.add(tpwd); }else{ temp=2; } }else{ temp=3; } }catch(SQLExceptione){ e.printStackTrace(); }finally{ DBConn.close(conn,st,rs); } returntemp; } publicArrayListgetArrayLst(){ returnal; }}packageservlet.admin;importjava.io.IOException;importjava.io.PrintWriter;importjavax.servlet.RequestDispatcher;importjavax.servlet.ServletConfig;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importbean.InsertUpdateDelBean;importsmartupload.SmartFile;importsmartupload.SmartUpload;importsmartupload.SmartUploadException;importutil.Validate;publicclassAddBookServletextendsHttpServlet{ privateServletConfigconfig; /** *Constructoroftheobject. */ publicAddBookServlet(){ super(); } finalpublicvoidinit(ServletConfigconfig)throwsServletException { this.config=config; } finalpublicServletConfiggetServletConfig() { returnconfig; } /** *Destructionoftheservlet.<br> */ publicvoiddestroy(){ super.destroy();//Justputs"destroy"stringinlog //Putyourcodehere } publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ Validatevd=newValidate(); Stringname=""; Stringauthor=""; Stringpublishing=""; Stringnumber=""; Stringprice=""; Stringstorage=""; Stringbrief=""; Stringtype=""; Stringpath=""; SmartUploadmySmartUpload=newSmartUpload();//init mySmartUpload.initialize(config,request,response); try{ mySmartUpload.upload(); name=vd.getUnicode(mySmartUpload.getRequest().getParameter("name").trim()); author=vd.getUnicode(mySmartUpload.getRequest().getParameter("author").trim()); publishing=vd.getUnicode(mySmartUpload.getRequest().getParameter("publishing").trim()); number=vd.getUnicode(mySmartUpload.getRequest().getParameter("number").trim()); price=vd.getUnicode(mySmartUpload.getRequest().getParameter("price").trim()); storage=vd.getUnicode(mySmartUpload.getRequest().getParameter("storage").trim()); brief=vd.getUnicode(mySmartUpload.getRequest().getParameter("brief").trim()); type=vd.getUnicode(mySmartUpload.getRequest().getParameter("type").trim()); intcount=0; SmartFilefile=mySmartUpload.getFiles().getFile(0); StringfileExt=file.getFileExt(); path="/bookimg"; InsertUpdateDelBeanib=newInsertUpdateDelBean(); Stringsql="insertintobooks([name],[author],[publishing],[number],[price],[storage],[brief],[type],[imgpath])"+ "values('"+name+"','"+author+"','"+publishing+"','"+number+"','"+price+"','"+storage+"','"+brief+"','"+type+"','"+path.substring(1)+"/"+file.getFileName()+"')"; ib.insertANDupdateANDdel(sql); count=mySmartUpload.save(path); }catch(SmartUploadExceptione){ //TODO自動(dòng)生成catch塊 e.printStackTrace(); } RequestDispatcherrd=request.getRequestDispatcher("/admin/booklist.jsp");rd.forward(request,response); } publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ doGet(request,response); } /** *Initializationoftheservlet.<br> * *@throwsServletExceptionifanerroroccure */ publicvoidinit()throwsServletException{ //Putyourcodehere }}packageservlet.admin;importjava.io.IOException;importjavax.servlet.RequestDispatcher;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importutil.Validate;importbean.InsertUpdateDelBean;publicclassAddTypeServletextendsHttpServlet{ /** *Constructoroftheobject. */ publicAddTypeServlet(){ super(); } /** *Destructionoftheservlet.<br> */ publicvoiddestroy(){ super.destroy();//Justputs"destroy"stringinlog //Putyourcodehere } publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ Validatevd=newValidate(); Stringname=vd.getUnicode(request.getParameter("name")); Stringsql="insertintotypesvalues('"+name+"')"; InsertUpdateDelBeanib=newInsertUpdateDelBean(); ib.insertANDupdateANDdel(sql); RequestDispatcherrd=request.getRequestDispatcher("/admin/typelist.jsp"); rd.forward(request,response); } publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ doGet(request,response); } /** *Initializationoftheservlet.<br> * *@throwsServletExceptionifanerroroccure */ publicvoidinit()throwsServletException{ //Putyourcodehere }}packageservlet.admin;importjava.io.IOException;importjava.util.ArrayList;importjavax.servlet.RequestDispatcher;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importjavax.servlet.http.HttpSession;importutil.Validate;importbean.AdminLoginBean;publicclassAdminLoginServletextendsHttpServlet{ /** *Constructoroftheobject. */ publicAdminLoginServlet(){ super(); } /** *Destructionoftheservlet.<br> */ publicvoiddestroy(){ super.destroy();//Justputs"destroy"stringinlog //Putyourcodehere } publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ Validatevd=newValidate(); Stringname=vd.getUnicode(request.getParameter("name")); Stringpwd=vd.getUnicode(request.getParameter("pwd")); Stringstr=""; AdminLoginBeanlb=newAdminLoginBean(); intflag=lb.login(name,pwd); ArrayListal=lb.getArrayLst(); HttpSessionsession=request.getSession(); session.setAttribute("adminlogin",al); if(flag==2||flag==3){ str="/admin/index.jsp"; request.setAttribute("error","1"); } if(flag==1){ str="/admin/booklist.jsp"; } RequestDispatcherrd=request.getRequestDispatcher(str);rd.forward(request,response); } publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ doGet(request,response); } /** *Initializationoftheservlet.<br> * *@throwsServletExceptionifanerroroccure */ publicvoidinit()throwsServletException{ //Putyourcodehere }}packageservlet.admin;importjava.io.IOException;importjava.io.PrintWriter;importjava.util.ArrayList;importjavax.servlet.RequestDispatcher;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importbean.SelectBean;publicclassAdminShowUserServletextendsHttpServlet{ /** *Constructoroftheobject. */ publicAdminShowUserServlet(){ super(); } /** *Destructionoftheservlet.<br> */ publicvoiddestroy(){ super.destroy();//Justputs"destroy"stringinlog //Putyourcodehere } publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ Stringid=request.getParameter("id"); SelectBeansb=newSelectBean(); Stringsql="select*fromuserswhereid='"+id+"'"; Stringargs[]={"id","name","pwd","realname","sex","age","card","address","phone","email","code","type"}; ArrayListal=sb.select(sql,args); request.setAttribute("user",al); RequestDispatcherrd=request.getRequestDispatcher("/admin/showuser.jsp");rd.forward(request,response); } publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ doGet(request,response); } /** *Initializationoftheservlet.<br> * *@throwsServletExceptionifanerroroccure */ publicvoidinit()throwsServletException{ //Putyourcodehere }}packageservlet.admin;importjava.io.IOException;importjava.io.PrintWriter;importjavax.servlet.RequestDispatcher;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importbean.InsertUpdateDelBean;importutil.Validate;publicclassDelServletextendsHttpServlet{ /** *Constructoroftheobject. */ publicDelServlet(){ super(); } /** *Destructionoftheservlet.<br> */ publicvoiddestroy(){ super.destroy();//Justputs"destroy"stringinlog //Putyourcodehere } publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ Validatevd=newValidate(); Stringbookid=vd.getUnicode(request.getParameter("id")); Stringtypeid=vd.getUnicode(request.getParameter("typeid")); Stringuserid=vd.getUnicode(request.getParameter("userid")); InsertUpdateDelBeanib=newInsertUpdateDelBean(); Stringsql=""; Stringstr=""; if(bookid!=null&&!bookid.equals("")){ str="/admin/booklist.jsp"; sql="deletefrombookswhereid='"+bookid+"'"; ib.insertANDupdateANDdel(sql); } if(typeid!=null&&!typeid.equals("")){ str="/admin/typelist.jsp"; sql="deletefromtypeswhereid='"+typeid+"'"; intflag=ib.insertANDupdateANDdel(sql); if(flag==-1){ request.setAttribute("error","1"); } } if(userid!=null&&!userid.equals("")){ str="/admin/userlist.jsp"; sql="deletefromuserswhereid='"+userid+"'"; ib.insertANDupdateANDdel(sql); } RequestDispatcherrd=request.getRequestDispatcher(str);rd.forward(request,response); } publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ doGet(request,response); } /** *Initializationoftheservlet.<br> * *@throwsServletExceptionifanerroroccure */ publicvoidinit()throwsServletException{ //Putyourcodehere }}packageservlet.admin;importjava.io.IOException;importjava.util.ArrayList;importjavax.servlet.RequestDispatcher;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importutil.Validate;importbean.SelectBean;publicclassKuXiaoServletextendsHttpServlet{ /** *Constructoroftheobject. */ publicKuXiaoServlet(){ super(); } /** *Destructionoftheservlet.<br> */ publicvoiddestroy(){ super.destroy();//Justputs"destroy"stringinlog //Putyourcodehere } publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ Validatevd=newValidate(); Stringkuda=vd.getUnicode(request.getParameter("kuda")); Stringkuxiao=vd.getUnicode(request.getParameter("kuxiao")); Stringsouda=vd.getUnicode(request.getParameter("souda")); Stringsouxiao=vd.getUnicode(request.getParameter("souxiao")); Stringsql="select*frombooks"; String[]args={"id","name","author","publishing","number","price","storage","brief","type","tate","sums","imgpath"}; if(kuda!=null&&!kuda.equals("")){ sql+="wherestorage>"+kuda; } if(kuxiao!=null&&!kuxiao.equals("")){ sql+="wherestorage<"+kuxiao; } if(souda!=null&&!souda.equals("")){ sql+="wheresums>"+souda; } if(souxiao!=null&&!souxiao.equals("")){ sql+="wheresums<"+souxiao; } SelectBeansb=newSelectBean(); ArrayListal=sb.select(sql,args); request.setAttribute("books",al); RequestDispatcherrd=request.getRequestDispatcher("/admin/kuxiao.jsp");rd.forward(request,response); } publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ doGet(request,response); } /** *Initializationoftheservlet.<br> * *@throwsServletExceptionifanerroroccure */ publicvoidinit()throwsServletException{ //Putyourcodehere }}packageservlet.admin;importjava.io.IOException;importjava.io.PrintWriter;importjava.util.ArrayList;importjavax.servlet.RequestDispatcher;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importbean.SelectBean;importutil.Validate;publicclassOrderListServletextendsHttpServlet{ /** *Constructoroftheobject. */ publicOrderListServlet(){ super(); } /** *Destructionoftheservlet.<br> */ publicvoiddestroy(){ super.destroy();//Justputs"destroy"stringinlog //Putyourcodehere } publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ Validatevd=newValidate(); Stringuserid=vd.getUnicode(request.getParameter("userid")); Stringbookname=vd.getUnicode(request.getParameter("bookname")); Stringorderda=vd.getUnicode(request.getParameter("orderda")); Stringorderxiao=vd.getUnicode(request.getParameter("orderxiao")); Stringsql="selecta.idasuserid,b.idasbookid,c.idasorderid,realname,phone,address,asbookname,booksum,price,timesfromusersa,booksb,orderscwherea.id=c.useridandb.id=c.bookid"; String[]args={"userid","bookid","orderid","realname","phone","address","bookname","booksum","price","times"}; if(userid!=null&&!userid.equals("")){ sql+="anda.id='"+userid+"'"; } if(bookname!=null&&!bookname.equals("")){ sql+="andlike'%"+bookname+"%'"; } if(orderda!=null&&!orderda.equals("")){ sql+="andc.booksum>'"+orderda+"'"; } if(orderxiao!=null&&!orderxiao.equals("")){ sql+="andc.booksum<'"+orderxiao+"'"; } SelectBeansb=newSelectBean(); ArrayListal=sb.select(sql,args); request.setAttribute("order",al); RequestDispatcherrd=request.getRequestDispatcher("/admin/order.jsp");rd.forward(request,response); } publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ doGet(request,response); } /** *Initializationoftheservlet.<br> * *@throwsServletExceptionifanerroroccure */ publicvoidinit()throwsServletException{ //Putyourcodehere }}packageservlet.admin;importjava.io.IOException;importjava.io.PrintWriter;importjava.util.ArrayList;importjavax.servlet.RequestDispatcher;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importjavax.servlet.http.HttpSession;importutil.Validate;importbean.InsertUpdateDelBean;publicclassPwdNameUserServletextendsHttpServlet{ /** *Constructoroftheobject. */ publicPwdNameUserServlet(){ super(); } /** *Destructionoftheservlet.<br> */ publicvoiddestroy(){ super.destroy();//Justputs"destroy"stringinlog //Putyourcodehere } publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ Validatevd=newValidate(); Stringnewpwd=vd.getUnicode(request.getParameter("newpwd")); Stringnewname=vd.getUnicode(request.getParameter("newname")); Stringname=vd.getUnicode(request.getParameter("name")); Stringpwd=vd.getUnicode(request.getParameter("pwd")); Stringxpwd=vd.getUnicode(request.getParameter("xpwd")); Stringxname=vd.getUnicode(request.getParameter("xname")); Stringxuser=vd.getUnicode(request.getParameter("xuser")); Stringuserpwd=vd.getUnicode(request.getParameter("userpwd")); Stringsql=""; Stringstr=""; InsertUpdateDelBeanib=newInsertUpdateDelBean(); HttpSessionsession=request.getSession(); ArrayListadminlogin=(ArrayList)session.getAttribute("adminlogin"); ArrayListlogin=(ArrayList)session.getAttribute("login"); Stringid=""; if(adminlogin!=null&&!adminlogin.equals("")){ id=(String)adminlogin.get(0); } Stringuserid=""; if(login!=null&&!login.equals("")){ userid=(String)login.get(0); } if(userpwd!=null&&userpwd.equals("1")){ sql="update[user]setpwd='"+newpwd+"'whereid='"+userid+"'"; str="/index.jsp"; ib.insertANDupdateANDdel(sql); }else{ if(xpwd!=null&&xpwd.equals("1")){ sql="updateadminsetpwd='"+newpwd+"'whereid='"+id+"'"; } if(xname!=null&&xname.equals("1")){ sql="updateadminsetname='"+newname+"'whereid='"+id+"'"; } if(xuser!=null&&xuser.equals("1")){ sql="insertintoadmin(name,pwd)values('"+name+"','"+pwd+"')"; } intflag=ib.insertANDupdateANDdel(sql); if(flag==-1){ request.setAttribute("error","1"); str="/admin/adduser.jsp"; }else{ session.removeAttribute("login"); str="/admin/index.jsp"; } } RequestDispatcherrd=request.getRequestDispatcher(str);rd.forward(request,response); } publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ doGet(request,response); } /** *Initializationoftheservlet.<br> * *@throwsServletExceptionifanerroroccure */ publicvoidinit()throwsServletException{ //Putyourcodehere }}packageservlet.admin;importjava.io.IOException;importjava.util.ArrayList;importjavax.servlet.RequestDispatcher;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importutil.Validate;importbean.InsertUpdateDelBean;importbean.SelectBean;publicclassUpdateBookServletextendsHttpServlet{ /** *Constructoroftheobject. */ publicUpdateBookServlet(){ super(); } /** *Destructionoftheservlet.<br> */ publicvoiddestroy(){ super.destroy();//Justputs"destroy"stringinlog //Putyourcodehere } publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ Validatevd=newValidate(); Stringid=vd.getUnicode(request.getParameter("id")); Stringname=vd.getUnicode(request.getParameter("name")); Stringauthor=vd.getUnicode(request.getParameter("author")); Stringpublishing=vd.getUnicode(request.getParameter("publishing")); Stringnumber=vd.getUnicode(request.getParameter("number")); Stringprice=vd.getUnicode(request.getParameter("price")); Stringstorage=vd.getUnicode(request.getParameter("storage")); Stringbrief=vd.getUnicode(request.getParameter("brief")); Stringtype=vd.getUnicode(request.getParameter("type")); Stringsql="updatebookssetname='"+name+"',author='"+author+"',publishing='"+publishing+"',number='"+number+"',price='"+price+"',storage='"+storage+"',brief='"+brief+"',type='"+type+"'whereid='"+id+"'"; InsertUpdateDelBeanib=newInsertUpdateDelBean(); ib.insertANDupdateANDdel(sql); SelectBeansb=newSelectBean(); Stringsql2="select*frombookswhereid='"+id+"'"; String[]args2={"id","name","author","publishing","number","price","storage","brief","type","tate","sums","imgpath"}; ArrayListal2=sb.select(sql2,args2); request.setAttribute("bookinf",al2); RequestDispatcherrd=request.getRequestDispatcher("/admin/updatebook.jsp");rd.forward(request,response); } publicvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ doGet(request,response); } /** *Initializationoftheservlet.<br> * *@throwsServletExceptionifanerroroccure */ publicvoidinit()throwsServletException{ //Putyourcodehere }}packageservlet.admin;importjava.io.IOException;importjava.io.PrintWriter;importjava.util.ArrayList;importjavax.servlet.RequestDispatcher;importjavax.servlet.ServletException;importjavax.servlet.http.HttpServlet;importjavax.servlet.http.HttpServletRequest;importjavax.servlet.http.HttpServletResponse;importutil.Validate;importbean.InsertUpdateDelBean;importbean.SelectBean;publicclassUpdateTypeServletextendsHttpServlet{ /** *Constructoroftheobject. */ publicUpdateTypeServlet(){ super(); } /** *Destructionoftheservlet.<br> */ publicvoiddestroy(){ super.destroy();//Justputs"destroy"stringinlog //Putyourcodehere } publicvoiddoGet(HttpServletRequestrequest,HttpServletResponseresponse) throwsServletException,IOException{ Validatevd=newValidate(); Stringid=vd.getUnicode(request.getParameter("id")); Stringname=vd.getUnicode(request.getParameter("name")); if(name!=null&&!name.equals("")){ Stringsql="updatetypessetname='"+name+"'whereid='"+id+"'"; InsertUpdateDelBeanib=newInsertUpdateDelBean(); ib.insertANDupdateANDdel(sql); } SelectBeansb=newSelectBean(); Stringsql2="select*fromtypeswhereid='"+id+"'"; String[]args2={"id","name"}; ArrayListal2=sb.select(sql2,args2); request.setAttribute("bookinf",al2); RequestDispatcherrd=request.getRequestDispatcher("/admin/updatetype.jsp");rd.forward(request,response); } publicvoiddoPost(HttpServletRequestrequest,HttpServletResponsere

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論