




已閱讀5頁,還剩23頁未讀, 繼續(xù)免費閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
Web程序設(shè)計 學(xué)生信息管理系統(tǒng) 姓名:魯超、劉千飛、肖偉超萬聯(lián)播、張明明、白浩班級: 軟件0901 時間:2011/12/22 一、實驗?zāi)康?熟練運用web開發(fā)技術(shù)設(shè)計完成一個學(xué)生信息管理系統(tǒng)。二、實驗原理功能要求:基于B/S架構(gòu)實現(xiàn)學(xué)生信息的增刪改查展示功能,實現(xiàn)完整的應(yīng)用構(gòu)建和界面設(shè)計。技術(shù)要求:基于mysql或mssqlserver數(shù)據(jù)庫,以Tomcat為應(yīng)用服務(wù)器,可使用Jsp+Servelt+Javabean完成,鼓勵使用struts,Hibernate框架完成設(shè)計。三、實驗分組成員姓名成員學(xué)號負責(zé)內(nèi)容魯超200907040101刪除模塊劉千飛200907040102登陸頁面及參與總體內(nèi)容設(shè)計肖偉超200907040103修改模塊萬聯(lián)播200907040104查詢模塊張明明200907040105分頁及參與總體內(nèi)容的設(shè)計白浩200907040107增加模塊四、實驗內(nèi)容登陸主頁源代碼:login.html:登陸模塊歡迎登陸學(xué)生信息管理系統(tǒng)用戶名:密碼:forward.jsp:login forwardjsp:param name=username value=/jsp:param name=username value=/jsp:param name=username value=/jsp:param name=username value=/login_ok.jsp:Insert title hereinputcolor:red;font-size:12pt;歡迎您使用學(xué)生管理系統(tǒng)%String username=null;String password=null;request.setCharacterEncoding(gb2312);response.setContentType(text/html;charset=gb2312);username=request.getParameter(username);password=request.getParameter(password);out.println(登陸成功,用戶名+username+,);out.println(密碼+password+);%請選擇您要進行的操作: error.jsp:Error歡迎您使用學(xué)生管理系統(tǒng)%String username=null;String password=null;request.setCharacterEncoding(gb2312);response.setContentType(text/html;charset=gb2312);username=request.getParameter(username);password=request.getParameter(password);out.println(您輸入的用戶名+username+,);out.println(和密碼+password+有一項為空,請重新輸入:);%-返回重新登陸-學(xué)生信息增加模塊:p_zeng.html:Insert title hereinputcolor:red;font-size:12pt;歡迎您使用學(xué)生管理系統(tǒng)%String username=null;String password=null;request.setCharacterEncoding(gb2312);response.setContentType(text/html;charset=gb2312);username=request.getParameter(username);password=request.getParameter(password);out.println(登陸成功,用戶名+username+,);out.println(密碼+password+);%請選擇您要進行的操作: zeng.jsp:call stored procedure % int PAGESIZE=3; int pageCount=0; int curPage=1; java.sql.Connection conn=null; PreparedStatement pstmt=null; Statement stmt=null; ResultSet rs=null; String cloStr=sno,sname,cclass,sex,age,nation,clname,place; String showStr=學(xué)生編號,學(xué)生姓名,所在年級,性別,年齡,民族,專業(yè),住址;String sno,sname,cclass,sex,age,nation,clname,place; String strURL=jdbc:mysql:/localhost/test; String strDBUser=root; String strDBPwd=123; try Class.forName(com.mysql.jdbc.Driver); conn=java.sql.DriverManager.getConnection(strURL,strDBUser,strDBPwd); catch(ClassNotFoundException e) e.printStackTrace(); out.println(您輸入的信息有誤,請查證后再重新輸入!); catch(Exception ex) ex.printStackTrace(); out.println(您輸入的信息有誤,請查證后再重新輸入!); try sno=request.getParameter(sno); byte no=sno.getBytes(ISO-8859-1); sno=new String(no); sname=request.getParameter(sname); byte name=sname.getBytes(ISO-8859-1); sname=new String(name,gb2312); cclass=request.getParameter(cclass); byte clss=cclass.getBytes(ISO-8859-1); cclass=new String(clss,gb2312); sex=request.getParameter(sex); byte ex=sex.getBytes(ISO-8859-1); sex=new String(ex,gb2312); age=request.getParameter(age); byte ge=age.getBytes(ISO-8859-1); age=new String(ge); nation=request.getParameter(nation); byte tion=nation.getBytes(ISO-8859-1); nation=new String(tion,gb2312); clname=request.getParameter(clname); byte cname=clname.getBytes(ISO-8859-1); clname=new String(cname,gb2312); place=request.getParameter(place); byte lace=place.getBytes(ISO-8859-1); place=new String(lace,gb2312); String sqlll=insert into S(sno,sname,cclass,sex,age,nation,clname,place) values(+sno+,+sname+,+cclass+,+sex+,+age+,+nation+,+clname+,+place+);pstmt=conn.prepareStatement(sqlll);int count3=pstmt.executeUpdate();/插入 String sqllll=select * from S; stmt=conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY); rs=stmt.executeQuery(sqllll); rs.last();int size=rs.getRow();pageCount=(size%PAGESIZE=0)?(size/PAGESIZE):(size/PAGESIZE+1); catch(Exception ex) ex.printStackTrace(); out.println(您輸入的信息有誤,請查證后再重新輸入!); /獲取想要顯示的頁數(shù): String integer=request.getParameter(curPage); if(integer=null) integer=1; try curPage=Integer.parseInt(integer); catch(NumberFormatException e) curPage=1; if(curPage=pageCount) curPage=pageCount; /如果要顯示第curPage頁,那么游標(biāo)應(yīng)移到posion的值是: int posion=(curPage-1)*PAGESIZE+1; rs.absolute(posion); / 設(shè)置游標(biāo)的位置%for(int i=0;ishowStr.length;i+)out.println();out.println(+showStri+);%=PAGESIZE)break; out.println();for(int i=0;icloStr.length;i+)out.println();out.println(+rs.getString(cloStri)+);out.println();count+;while(rs.next();%首頁 a href = cha.jsp?curPage= 上一頁 a href = cha.jsp?curPage= 下一頁 a href = cha.jsp?curPage= 尾頁 第頁/共頁 輸入頁碼數(shù) 學(xué)生信息刪除模塊:p_shan.html:Insert title hereh3color:red;歡迎您使用學(xué)生管理系統(tǒng)返回首頁刪 除 操 作請輸入學(xué)生學(xué)號:請輸入學(xué)生姓名:請輸入學(xué)生性別:請輸入學(xué)生住址:按學(xué)號刪除: Shan_xuehao.jsp:call stored procedure % int PAGESIZE=3; int pageCount=0; int curPage=1; java.sql.Connection conn=null; PreparedStatement pstmt=null; Statement stmt=null; ResultSet rs=null; String cloStr=sno,sname,cclass,sex,age,nation,clname,place; String showStr=學(xué)生編號,學(xué)生姓名,所在年級,性別,年齡,民族,專業(yè),住址; String sno; if(conn=null) String strURL=jdbc:mysql:/localhost/test; String strDBUser=root; String strDBPwd=123; try Class.forName(com.mysql.jdbc.Driver); out.println(連接數(shù)據(jù)庫成功.); conn=java.sql.DriverManager.getConnection(strURL,strDBUser,strDBPwd); catch(ClassNotFoundException e) e.printStackTrace(); out.println(ClassNotFoundException111); catch(Exception ex) ex.printStackTrace(); out.println(Exception11); trysno=request.getParameter(sno); byte no=sno.getBytes(ISO-8859-1); sno=new String(no);String sql=delete from S where sno=+sno;pstmt=conn.prepareStatement(sql);int count=pstmt.executeUpdate();/刪除String sqllll=select * from S;stmt=conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY);rs=stmt.executeQuery(sqllll);rs.last();int size=rs.getRow();pageCount=(size%PAGESIZE=0)?(size/PAGESIZE):(size/PAGESIZE+1);catch(Exception ex) ex.printStackTrace(); out.println(您輸入的信息有誤,請查證后再重新輸入!); /獲取想要顯示的頁數(shù): String integer=request.getParameter(curPage); if(integer=null) integer=1; try curPage=Integer.parseInt(integer); catch(NumberFormatException e) curPage=1; if(curPage=pageCount) curPage=pageCount; /如果要顯示第curPage頁,那么游標(biāo)應(yīng)移到posion的值是: int posion=(curPage-1)*PAGESIZE+1; rs.absolute(posion); / 設(shè)置游標(biāo)的位置%for(int i=0;ishowStr.length;i+)out.println();out.println(+showStri+
溫馨提示
- 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)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年吉林省建筑安全員C證考試(專職安全員)題庫及答案
- 2025-2030年中國衣物柔順劑行業(yè)發(fā)展?fàn)顩r及營銷戰(zhàn)略研究報告
- 2025-2030年中國薺藍油市場發(fā)展現(xiàn)狀規(guī)劃研究報告
- 2025-2030年中國硅酸鋯行業(yè)前景趨勢及發(fā)展規(guī)劃分析報告
- 2025-2030年中國礦物棉市場營運狀況及發(fā)展策略研究報告
- 2025波蘭數(shù)學(xué)奧林匹克(第二輪)試題
- 2025遼寧省建筑安全員B證考試題庫
- 合肥幼兒師范高等??茖W(xué)?!稘h字文化與創(chuàng)新設(shè)計》2023-2024學(xué)年第二學(xué)期期末試卷
- 河北美術(shù)學(xué)院《中小學(xué)教學(xué)名師論壇》2023-2024學(xué)年第二學(xué)期期末試卷
- 湖南電氣職業(yè)技術(shù)學(xué)院《現(xiàn)代辦公技能訓(xùn)練A》2023-2024學(xué)年第二學(xué)期期末試卷
- 多聯(lián)機空調(diào)系統(tǒng)設(shè)計課件
- 螺紋牙強度校核計算
- 技術(shù)規(guī)范書柴油發(fā)電機組
- 青島科技大學(xué)成人大?!豆ど唐髽I(yè)管理實訓(xùn)報告》
- 低鉀血癥最新版本最新課件
- 獸醫(yī)外科手術(shù)學(xué)與獸醫(yī)外科學(xué)章節(jié)測試及答案
- 2023年陜西延長石油礦業(yè)有限責(zé)任公司招聘筆試題庫及答案解析
- YY/T 1792-2021熒光免疫層析分析儀
- GB/T 39235-2020豬營養(yǎng)需要量
- GB/T 30799-2014食品用洗滌劑試驗方法重金屬的測定
- 染廠公司簡介(4個范本)
評論
0/150
提交評論