基于BBS論壇系統(tǒng)設(shè)計與實現(xiàn)樣本_第1頁
基于BBS論壇系統(tǒng)設(shè)計與實現(xiàn)樣本_第2頁
基于BBS論壇系統(tǒng)設(shè)計與實現(xiàn)樣本_第3頁
基于BBS論壇系統(tǒng)設(shè)計與實現(xiàn)樣本_第4頁
基于BBS論壇系統(tǒng)設(shè)計與實現(xiàn)樣本_第5頁
已閱讀5頁,還剩19頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

目錄1背景及意義 12系統(tǒng)總體設(shè)計 31系統(tǒng)目的 32系統(tǒng)功能劃分 41前臺功能構(gòu)造 42后臺功能構(gòu)造 53系統(tǒng)開發(fā)環(huán)境 51開發(fā)環(huán)境 62系統(tǒng)平臺體系構(gòu)造選取 63JavaScript語言簡介及特點 64JSP概述 65MySQL 76JDBC技術(shù) 73數(shù)據(jù)庫設(shè)計 83.1數(shù)據(jù)庫分析 93.2數(shù)據(jù)庫概念設(shè)計 103.3數(shù)據(jù)庫邏輯設(shè)計 114系統(tǒng)詳細設(shè)計與實現(xiàn) 114.1前臺設(shè)計 121前臺頁面設(shè)計與實現(xiàn) 132顧客登錄、管理員登錄 143論壇版塊展示 144刊登新主題 155查看及回答主題 154.2后臺設(shè)計 161管理員登錄 162顧客信息管理 17結(jié)束語 17參照文獻 182.1前臺功能構(gòu)造2.2后臺功能構(gòu)造1開發(fā)環(huán)境2系統(tǒng)平臺體系構(gòu)造選取3JSP概述3.3.5MySQL3.3.6JDBC技術(shù)表4-3article134567891011121前臺頁面設(shè)計與實現(xiàn)<% List<Article>articles=newArrayList<Article>(); Connectionconn=DB.getConn(); //創(chuàng)立與數(shù)據(jù)庫連結(jié) Statementstmt=DB.createStmt(conn); //通過連結(jié)創(chuàng)立Statement對象 Stringsql="select*fromarticle"; ResultSetrs=DB.executeQuery(stmt,sql); //執(zhí)行sql語句,并返回成果集 while(rs.next()){ Articlea=newArticle(); a.initFromRs(rs); articles.add(a); } //記錄總查看量 inttotalViewNum=0; //記錄帖子總數(shù) inttotalArticleNum=0; /*查詢出帖子總查看量*/ for(Iterator<Article>it=articles.iterator();it.hasNext();){ Articlea=it.next(); totalViewNum+=a.getViewCount(); } /*查詢出帖子總回答量*/ Stringsql1="selectcount(id)fromarticlewherepid=0"; ResultSetrs1=DB.executeQuery(stmt,sql1); rs1.next(); totalArticleNum=rs1.getInt(1); /*查詢出最后發(fā)帖作者*/ Stringsql2="select*fromarticleorderbypdatedesc"; ResultSetrs2=DB.executeQuery(stmt,sql2); while(rs2.next()){ Articlea=newArticle(); a.initFromRs(rs2); articles.add(a); } Iterator<Article>it1=articles.iterator(); Articlea1=it1.next(); StringlastWriter=a1.getWriter(); DB.close(rs2); DB.close(rs1); DB.close(rs); DB.close(stmt); DB.close(conn); %>2顧客登錄、管理員登錄<DD><Aclass=jive-acc-loginhref="http://localhost:8080/BBS/loginUser.jsp">普通顧客注冊</A></DD><DD><Aclass=jive-acc-loginhref="http://localhost:8080/BBS/recordUser.jsp">普通顧客登錄</A></DD><Aclass=jive-acc-loginhref="http://localhost:8080/BBS/recordManager.jsp">管理員登錄入口</A>3論壇版塊展示<%intlineNum=0; for(Iterator<Article>it=articles.iterator();it.hasNext();){ Articlea=it.next(); StringclassStr=lineNum%2==0?"jive-even":"jive-odd";//區(qū)別奇偶行,以不同效果區(qū)別顯示%><%finalintPAGE_SIZE=8;//每頁顯示主題數(shù)目 intpageNo=1;//記錄當前頁數(shù) StringstrPageNo=request.getParameter("pageNo"); if(strPageNo!=null&&!strPageNo.trim().equals("")){ try{ pageNo=Integer.parseInt(strPageNo); }catch(NumberFormatExceptione){ pageNo=1; } } if(pageNo<=0){ pageNo=1; } inttotalPages=0;//記錄符合規(guī)定總主題頁數(shù) List<Article>articles=newArrayList<Article>(); Connectionconn=DB.getConn(); StatementstmtCount=DB.createStmt(conn); ResultSetrsCount=DB.executeQuery(stmtCount, "selectcount(*)fromarticlewherepid=0"); rsCount.next(); inttotalRecords=rsCount.getInt(1); totalPages=(totalRecords+PAGE_SIZE-1)/PAGE_SIZE; if(pageNo>totalPages){ pageNo=totalPages; } Statementstmt=DB.createStmt(conn); intstartPos=(pageNo-1)*PAGE_SIZE; Stringsql="select*fromarticlewherepid=0orderbypdatedesclimit" +startPos+","+PAGE_SIZE; ResultSetrs=DB.executeQuery(stmt,sql); while(rs.next()){ Articlea=newArticle(); a.initFromRs(rs); articles.add(a); }<%intlineNum=0;for(Iterator<Article>it=articles.iterator();it.hasNext();){ Articlea=it.next(); StringclassStr=lineNum%2==0?"jive-even":"jive-odd";<TRclass="<%=classStr%>"><%lineNum++;%>4刊登新主題5查看及回答主題<!--fckeditor--><scripttype="text/javascript"src="FCKeditor/fckeditor.js"></script> <scripttype="text/javascript">window.onload=function(){ //Automaticallycalculatestheeditorbasepathbasedonthe_samplesdirectory. //Thisisusefullonlyforthesesamples.Arealapplicationshouldusesomethinglikethis: //oFCKeditor.BasePath='/fckeditor/'; //'/fckeditor/'isthedefaultvalue. varsBasePath="<%=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/FCKeditor/"%>"; varoFCKeditor=newFCKeditor('cont'); oFCKeditor.BasePath =sBasePath; oFCKeditor.ReplaceTextarea();} </script><!-

溫馨提示

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

評論

0/150

提交評論