freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于java的網(wǎng)上投票系統(tǒng)(doc畢業(yè)設(shè)計(jì)論文)(編輯修改稿)

2025-07-21 00:59 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 題ID號(hào)Int不為空Item該問(wèn)題選項(xiàng)內(nèi)容Varchar 500不為空ItemCount該選項(xiàng)獲得的投票數(shù)Int不為空投票選項(xiàng)表(Items)包括的字段為投票問(wèn)題ID號(hào)、該問(wèn)題選項(xiàng)內(nèi)容、該選項(xiàng)獲得的投票數(shù)。,該網(wǎng)頁(yè)先讀取投票問(wèn)題表(Questions)中所有可見的問(wèn)題,然后根據(jù)每一個(gè)問(wèn)題的ID號(hào)在投票選項(xiàng)表(ltems)中找到該問(wèn)題的對(duì)應(yīng)選項(xiàng)并最終顯示在網(wǎng)頁(yè)上。當(dāng)用戶完成自己的投票后。投票問(wèn)題表(Questions)與投票選項(xiàng)表(Items)在SQLServer 2000中的數(shù)據(jù)庫(kù)邏輯關(guān)系如下圖所示。第五章 系統(tǒng)開發(fā) 客戶投票模塊用戶登錄在線投票系統(tǒng)后首先看到的就是該頁(yè)面,該頁(yè)面從數(shù)據(jù)庫(kù)中讀取所有的可見問(wèn)題及其選項(xiàng)后以網(wǎng)頁(yè)的形式顯示,并且接收用戶的投票,然后把用戶的投票信息提交給數(shù)據(jù)接收頁(yè)。程序說(shuō)明:用戶投票首頁(yè)。程序模塊名稱:。相關(guān)數(shù)據(jù)表:投票問(wèn)題表(Questions)、投票選項(xiàng)表(Items)。用戶投票頁(yè)的部分代碼如下: String permit。 String SqlString=SELECT Question,QuestionID from questions where IsVisable = 1。try { ResultSet rs=null。 ResultSet ch_rs=null。 //設(shè)置連接(,jdbc:microsoft:sqlserver://localhost:1433。DatabaseName=questionnaire,sa,)。 //設(shè)置SQL語(yǔ)句 rs=(SqlString)。 //得到查詢結(jié)果 int questionid = 0,itemid = 0。 int i=0,j。 //題目及選項(xiàng)標(biāo)號(hào) while(()) { i++。 String question = (1)。 questionid= (2)。 (TABLE borderColor=999999 cellSpacing=0 cellPadding=0 width=100% border=0tr bgcolor=999999td+ +i+.+ +question+/td/tr)。//子查詢語(yǔ)句,根據(jù)問(wèn)題id號(hào)到items表中查詢?cè)搯?wèn)題的所有選項(xiàng) String ch_sql = SELECT Item,ItemID From Items Where QuestionID =39。+questionid+39。 ch_rs=(ch_sql)。 j = 0。 while(()) { j++。 String item = (1)。 // itemid = (2)。 % td %=j%input type=radio value=%=itemid% name=%=questionid%%=item% /td/tr % } ( /tablep)。 } } catch(SQLException e1) { (SQL異常!)。 },該頁(yè)把這些數(shù)據(jù)項(xiàng)儲(chǔ)存到數(shù)據(jù)庫(kù)中.并提示用戶投票數(shù)據(jù)提交成功。程序說(shuō)明:數(shù)據(jù)接收頁(yè)。程序模塊名稱:相關(guān)數(shù)據(jù)表:投票問(wèn)題表(Questions)、投票選項(xiàng)表(Items)數(shù)據(jù)接收頁(yè)的代碼如下:ResultSet rs=null。 ResultSet ch_rs=null。//查詢所有可見問(wèn)題 String sqlstring = SELECT QuestionID from questions where IsVisable = 1 。try { rs=(sqlstring)。 int questionid = 0,itemid = 0。 while(()) { questionid = (1)。 //獲取用戶選擇的該問(wèn)題的選項(xiàng)的id號(hào) itemid = (((questionid)))。 //更新該問(wèn)題選擇的計(jì)數(shù)值,做加1操作 sqlstring = update Items set ItemCount = ItemCount + 1 Where ItemID =+itemid。 (sqlstring)。 } }catch(SQLException e1) { (SQL異常!)。 }。.查看該頊投票的統(tǒng)計(jì)結(jié)果.該頁(yè)就是用柱狀圖的顯示給出統(tǒng)計(jì)圖,并給出投票問(wèn)題每個(gè)選項(xiàng)的百分比。程序說(shuō)明:數(shù)據(jù)顯示頁(yè)。程序模塊名稱:相關(guān)數(shù)據(jù)表:投票問(wèn)題表(Questions)、投票選項(xiàng)表(Items)數(shù)據(jù)顯示頁(yè)的代碼如下:String question,date,Sqlstring。 ResultSet rs=null。 //定義數(shù)據(jù)集 ResultSet rs1=null。 ResultSet rs2=null。 int questionid = 0。 Sqlstring = SELECT Question, Date, QuestionID from questions where IsVisable = 1 and IsOpen= 1。 //查詢所有問(wèn)題內(nèi)容可見且投票結(jié)果可見的問(wèn)題 rs=(Sqlstring)。 Sqlstring = SELECT ItemCount From Items Where QuestionID =+questionid。 rs1 = (Sqlstring)。 int totalcount = 0。 while(()) { totalcount += (1)。 } if(totalcount==0) { (暫時(shí)還沒有人參加本題投票)。 Sqlstring = SELECT Item, ItemCount FROM Items where QuestionID =+questionid。 rs2 = (Sqlstring)。 String item。 int itemcount。 String percent。 while(()) { item = (1)。 itemcount = (2)。 percent = printf(((double)itemcount/totalcount*100)+0)。 (trtd+item+/td)。 (td align=center+itemcount+/td)。 (/tr)。 } } else { (共有+totalcount+人參加本題投票)。 Sqlstring = SELECT Item, ItemCount FROM Items where QuestionID =+questionid。 rs2 = (Sqlstring)。 String item。 int itemcount。 String percent。 while(()) { item = (1)。 itemcount = (2)。 percent = printf(((double)itemcount/totalcount*100)+0)。 (trtd+item+/td)。 (td align=center+itemcount+/td)。 (tdimg src = width = +(percent)*2+ height = 10+ percent+%)。 (/tr)。 } }此頁(yè)面主要用于解決中文字符無(wú)法正確顯示的問(wèn)題,這是一個(gè)基礎(chǔ)頁(yè)面,在其他所有的頁(yè)面都有可能調(diào)用該頁(yè)的函數(shù)。程序說(shuō)明:字符轉(zhuǎn)換頁(yè)。程序模塊名稱:。相關(guān)數(shù)據(jù)表:無(wú)。字符轉(zhuǎn)換頁(yè)代碼如下:%! String convert(String str) { byte newstr[] = new byte[()]。 for(int i=0。i()。i++) newstr[i]=(byte)(i)。 return new String(newstr)。 } String Replace(String str) { int index=0。 while((index=(\n)) != 1) str = (0,index) +br+ (index+1)。 return(str)。 }% 管理員模塊1. 管理員登陸頁(yè)程序說(shuō)明:管理員登錄頁(yè)。程序模塊名稱:。相關(guān)數(shù)據(jù)表:無(wú)。管理員登錄頁(yè)部分代碼如下:String errmsg = (errmsg)。 (true)。 String chk = false。 (Enter,chk)。if(errmsg != null amp。amp。 (error1)) (您輸入管理員帳號(hào)或者密碼不正確!!)。 else if(errmsg != null amp。amp。 (error2)) (請(qǐng)先登陸!!)。2. 管理員驗(yàn)證頁(yè)。,這些數(shù)據(jù)將被提交到該頁(yè),然后與數(shù)據(jù)庫(kù)中的相應(yīng)數(shù)據(jù)進(jìn)行對(duì)比。如果驗(yàn)證通過(guò)將跳轉(zhuǎn)到管理主頁(yè)面。程序說(shuō)明:管理員驗(yàn)證頁(yè)。程序模塊名稱:。相關(guān)數(shù)據(jù)庫(kù):管理員信息表(Admins)。管理員驗(yàn)證頁(yè)部分代碼如下:ResultSet rs=null。 String name = (name)。 String password = (password)。//根據(jù)用戶提交的用戶名和密碼查詢admins表 String sqlstring = select * from admins where Admname = 39。+name+39。 and Admpwd= 39。+password+39。 rs = (sqlstring)。if(!=NULL){if(()) {//查詢數(shù)據(jù)集不為空,說(shuō)明用戶名和密碼正確, (true)。 String chk=true。 (Enter,chk)。 ()。 } else { //查詢數(shù)據(jù)集為空,說(shuō)明用戶名和密碼不正確,重新跳轉(zhuǎn)到登陸頁(yè) String errmsg=error1。 (?errmsg=+errmsg)。 }}3. 在線投票系統(tǒng)的管理主頁(yè)面。在管理員通過(guò)用戶名和密碼的驗(yàn)證后,系統(tǒng)將跳轉(zhuǎn)到該頁(yè)面。,管理員單擊問(wèn)題就能查看投票的結(jié)果,管理員還可以選擇編輯該投票或者刪除該投票。管理員可以撤銷或恢復(fù)某投票。當(dāng)管理員單擊撤銷某投票后,該項(xiàng)投票項(xiàng)將對(duì)客戶不可見。但管理員有查看此投票及其統(tǒng)計(jì)結(jié)果的權(quán)限,在單擊恢復(fù)后,該投票又將恢復(fù)到最初對(duì)所有用戶可見的狀態(tài),管理員還可以設(shè)置投票結(jié)果是否公布,當(dāng)管理員單擊某投票的隱藏結(jié)果后,該投票項(xiàng)可以繼續(xù)接收用戶訪問(wèn),只是投票的統(tǒng)計(jì)結(jié)果變?yōu)榱瞬还_。程序說(shuō)明:管理主頁(yè)面。程序模塊名稱:。相關(guān)數(shù)據(jù)庫(kù):投票問(wèn)題表(Questions)、投票選項(xiàng)表(Items)。管理主頁(yè)面部分代碼如下所示。ResultSet rs=null。//查詢所有可見的問(wèn)題 String sqlstring = select * from questions where IsVisable=1。 rs = (sqlstring)。 String question,date。 int isvisable。 int questionid 。 int id = 0。 int isope
點(diǎn)擊復(fù)制文檔內(nèi)容
物理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1