《學(xué)生基本信息管理系統(tǒng)文檔1》_第1頁
《學(xué)生基本信息管理系統(tǒng)文檔1》_第2頁
《學(xué)生基本信息管理系統(tǒng)文檔1》_第3頁
《學(xué)生基本信息管理系統(tǒng)文檔1》_第4頁
《學(xué)生基本信息管理系統(tǒng)文檔1》_第5頁
已閱讀5頁,還剩22頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、北方民族大學(xué)課程設(shè)計(jì)報(bào)告 系(部、中心) 計(jì)算機(jī)科學(xué)與工程學(xué)院 姓 名 李昌玲 學(xué) 號 20082546 專 業(yè) 網(wǎng)絡(luò)工程 班 級 081 同組人員 陸巍 艾安健 設(shè)計(jì)題目名稱 學(xué)生基本信息管理系統(tǒng) 起止時間 2011-5-17-2011-5-25 成 績 指導(dǎo)教師簽名 北方民族大學(xué)教務(wù)處制學(xué)生基本信息管理系統(tǒng)開發(fā)摘要:學(xué)生基本信息管理系統(tǒng)的開發(fā)主要是為了學(xué)院能夠更好的管理各個班級,同時也間接地方便了學(xué)校對各個學(xué)院的管理。該系統(tǒng)可實(shí)現(xiàn)多種條件下的對班級和學(xué)生的信息更改,也可實(shí)現(xiàn)按不同條件統(tǒng)計(jì)學(xué)生的人數(shù)。關(guān)鍵字:學(xué)生基本信息管理系統(tǒng) 信息更改 統(tǒng)計(jì)the development of stude

2、nts basic information management systemabstract:class information management system mainly function is that can better manage each class, also can provides convenience to school to manage each college. this system can realize change class and students information with various conditions, also can ac

3、hieve statistical the number of the students according to different conditions.keywords:students basic information management systeminformation change statistic目錄1項(xiàng)目概述02 需求分析02.1 業(yè)務(wù)需求分析022系統(tǒng)功能模塊劃分02.3 系統(tǒng)流程圖02.4 任務(wù)劃分03 數(shù)據(jù)模型分析03.1 e-r模型13.2 關(guān)系表13.3 數(shù)據(jù)字典23.4 數(shù)據(jù)庫實(shí)現(xiàn)主要程序代碼34 系統(tǒng)實(shí)現(xiàn)54.1登錄模塊與查詢統(tǒng)計(jì)實(shí)現(xiàn)54.1.1算法流程圖

4、54.1.2主要程序代碼54.2班級信息管理實(shí)現(xiàn)54.2.1算法流程圖54.2.2主要程序代碼54.3學(xué)生信息管理實(shí)現(xiàn)54.3.1算法流程圖54.3.2主要程序代碼55 系統(tǒng)測試55.1 系統(tǒng)實(shí)現(xiàn)部分截圖55.2 測試數(shù)據(jù)和結(jié)果56 結(jié)束語5參考文獻(xiàn)51項(xiàng)目概述班級信息管理系統(tǒng)的開發(fā)主要是為了學(xué)院能夠更好的管理各個班級,同時也間接地方便了學(xué)校對各個學(xué)院的管理。該系統(tǒng)預(yù)期實(shí)現(xiàn)以下功能:1.按班級名、系名、院名對班級信息進(jìn)行增刪改查;2.按學(xué)號和姓名對學(xué)生信息進(jìn)行增刪改查;3.按不同要求(班級、系、學(xué)院、年齡、性別)統(tǒng)計(jì)人數(shù)以及按學(xué)號和姓名查詢該學(xué)生所屬班級、系和學(xué)院。2 需求分析2.1 業(yè)務(wù)需求

5、分析22系統(tǒng)功能模塊劃分 2.3 系統(tǒng)流程圖2.4 任務(wù)劃分3 數(shù)據(jù)模型分析3.1 e-r模型3.2 關(guān)系表 學(xué)生表(student)學(xué)號姓名性別年齡所在班級所在系別所在學(xué)院snosnamesexagecnamednameconame班級表(class)班級名所在系別所在學(xué)院cnamednameconame系表(department)系名所在學(xué)院dnameconame院表(college)院名coname管理員表(admin)用戶賬號用戶名字用戶密碼usernousernamepassword3.3 數(shù)據(jù)字典 student字段名稱數(shù)據(jù)類型長度主/外鍵約束備注snonumber4主鍵非空sna

6、mevarchar220非空sexvarchar220非空agenumber4非空cnamevarchar220外鍵非空參照“class”中的“cname”dnamevarchar220外鍵非空參照“department”中的“dname”conamevarchar220外鍵非空參照“college”中的“coname”class字段名稱數(shù)據(jù)類型長度主/外鍵約束備注cnamevarchar220主鍵非空dnamevarchar220外鍵非空參照“department”中的“dname”conamevarchar220外鍵非空參照“college”中的“coname”department字段名稱

7、數(shù)據(jù)類型長度主/外鍵約束備注dnamevarchar220主鍵非空conamevarchar220外鍵非空參照“college”中的“coname”college字段名稱數(shù)據(jù)類型長度主/外鍵約束備注conamevarchar220主鍵非空admin 字段名稱數(shù)據(jù)類型長度主/外鍵約束備注usernonumber6主鍵非空usernamevarchar220/非空passwordvarchar210/非空3.4 數(shù)據(jù)庫實(shí)現(xiàn)主要程序代碼創(chuàng)建用戶 lal 密碼 lal:sql create user lal identified by lal default tablespace users quot

8、a 10m on users account unlock;為lal授權(quán):sql grant create session,create view,create table,create any index to lal with admin option;連接用戶:sql conn lal/lalorcl創(chuàng)建college表sql create table college ( 2 coname varchar(20) constraint co_pk primary key 3 );創(chuàng)建dept表sql create table dept ( dname varchar(20) constr

9、aint d_pk primary key, coname varchar2(20) constraint d_fk3 references college (coname) );創(chuàng)建class表sql create table class( cname varchar(20) constraint c_pk primary key, dname varchar2(20) constraint c_fk2 references dept (dname), coname varchar2(20) constraint c_fk3 references college (coname) );創(chuàng)建s

10、tudent表sql create table student ( sno number(6) constraint s_pk primary key, sname varchar2(20) not null, sex varchar2(8) constraint s_ck1 check(sex in(男,女), age number(4) not null , cname varchar2(20) constraint s_fk1 foreign key(cname) references class(cname), dname varchar2(20) constraint s_fk2 f

11、oreign key(dname) references dept (dname), coname varchar2(20) constraint s_fk3 foreign key(coname) references college (coname) );為college表添加數(shù)據(jù)insert into college values(計(jì)算機(jī));insert into college values(法學(xué)院);insert into college values(商學(xué)院);insert into college values(材料學(xué)院);insert into college values(信

12、計(jì)學(xué)院);為dept表添加數(shù)據(jù)insert into dept values(網(wǎng)絡(luò)工程,計(jì)算機(jī));insert into dept values(軟件工程,計(jì)算機(jī));insert into dept values(計(jì)算機(jī)系,計(jì)算機(jī));insert into dept values(國際系,法學(xué)院);insert into dept values(金融系,計(jì)算機(jī));為class表添加數(shù)據(jù)insert into class values(08網(wǎng)絡(luò)一班,網(wǎng)絡(luò)工程,計(jì)算機(jī));insert into class values(08軟件一班,軟件工程,計(jì)算機(jī));insert into class valu

13、es(08計(jì)算機(jī)二班,計(jì)算機(jī)系,計(jì)算機(jī));insert into class values(08國際法一班,國際系,法學(xué)院);insert into class values(08金融二班,金融系,商學(xué)院);為student表添加數(shù)據(jù)insert into student values(080001,王偉,男,21,08計(jì)算機(jī)二班,計(jì)算機(jī)系,計(jì)算機(jī));insert into student values(080002,張蕊,女,21,08計(jì)算機(jī)二班,計(jì)算機(jī)系,計(jì)算機(jī));insert into student values(080005,李澤,男,20,08網(wǎng)絡(luò)一班,網(wǎng)絡(luò)工程,計(jì)算機(jī));inse

14、rt into student values(080007,張迪,男,22,08網(wǎng)絡(luò)一班,網(wǎng)絡(luò)工程,計(jì)算機(jī));insert into student values(080012,艾薇,女,21,08網(wǎng)絡(luò)一班,網(wǎng)絡(luò)工程,計(jì)算機(jī));insert into student values(080035,王帥,男,21,08軟件一班,軟件工程,計(jì)算機(jī));insert into student values(080053,徐國璽,女,21,08國際法一班,國際系,法學(xué)院);insert into student values(080058,盧娟,女,22,08金融二班,金融系,商學(xué)院);創(chuàng)建管理員admi

15、n表create table admin (userno number(6) constraint ad_pk primary key,username varchar2(20) not null,password varchar2(10) not null)為admin添加數(shù)據(jù)insert into admin values(00001234,王東,111111);insert into admin values(00001235,謝鋒,111112);事物提交commit;4 系統(tǒng)實(shí)現(xiàn)4.1 登錄模塊與查詢統(tǒng)計(jì)實(shí)現(xiàn)4.1.1 主要程序代碼用戶登錄% string userno=reques

16、t.getparameter(userno); string password=request.getparameter(password); connection con; statement sql; resultset rs; try class.forname(oracle.jdbc.driver.oracledriver); catch(exception e) out.print(e); try con=drivermanager.getconnection(jdbc:oracle:thin:127.0.0.1:1521:orcl,lal,lal); sql=con.creates

17、tatement(); rs=sql.executequery( select * from admin where userno= + userno + and password = + password + ); /如果記錄集非空,表明有匹配的用戶名和密碼,登陸成功 if ( rs.next ( ) ) session.setattribute(no, userno); session.setattribute(pass, password); out.print ( 登錄成功! ); out.print( 您的用戶id是:+userno ); out.print( 您的密碼是:+pass

18、word); % 修改密碼 新建賬戶 刪除賬戶 歡迎登錄到班級信息管理系統(tǒng)_統(tǒng)計(jì)信息 歡迎登錄到班級信息管理系統(tǒng)_查詢歸屬 返回 修改密碼測試登錄 新建賬戶測試登錄刪除賬戶測試登錄 4.2 院系以及班級信息管理實(shí)現(xiàn)4.2.1 算法流程圖4.2.2 主要程序代碼addclassbean.java /添加班級信息package tom.jiafei;import java.sql.*;public class addclassbean string cname=, /班級名 dname=, /系名 coname=; /學(xué)院名 string addmessage=; public addclassb

19、ean() try class.forname(sun.jdbc.odbc.jdbcodbcdriver); catch(classnotfoundexception e) public void setcname(string s) cname=s.trim(); /從當(dāng)前 string 對象移除所有前導(dǎo)空白字符和尾部空白字符。 try byte bb=cname.getbytes(iso-8859-1); cname=new string(bb,gb2312); catch(exception e) public void setdname(string s) dname=s.trim()

20、; try byte bb=dname.getbytes(iso-8859-1); dname=new string(bb,gb2312); catch(exception e) public void setconame(string s) coname=s.trim(); try byte bb=coname.getbytes(iso-8859-1); coname=new string(bb,gb2312); catch(exception e) public string getaddmessage() string insertcondition=insert into class

21、values( +cname+, +dname+,+coname+); string str=; connection con=null; statement sql=null; try con=drivermanager.getconnection(jdbc:odbc:jsp_oracle,lal,lal); sql=con.createstatement(); catch(sqlexception e) str=aa+e; try if(cname.length()0) int m=sql.executeupdate(insertcondition); if(m!=0) str=對表中添加

22、+m+條記錄成功; else str=添加記錄失敗; else str=請輸入班級名; con.close(); catch(sqlexception e) str=輸入的班級名不允許重復(fù)+e; return str; conditiondelete.java /刪除班級信息package tom.jiafei;import java.sql.*;public class conditiondelete string cname ; /學(xué)號 string dname; /系名 string coname; string deleteresultbycname, /刪除結(jié)果 deleteresu

23、ltbydname, deleteresultbyconame; public conditiondelete() try class.forname(sun.jdbc.odbc.jdbcodbcdriver); catch(classnotfoundexception e) public void setcname(string s) cname=s.trim(); try byte bb=cname.getbytes(iso-8859-1); cname=new string(bb,gb2312); catch(exception e) public string getcname() r

24、eturn cname; public void setdname(string s) dname=s.trim(); try byte bb=dname.getbytes(iso-8859-1); dname=new string(bb,gb2312); catch(exception e) public string getdname() return dname; public void setconame(string s) coname=s.trim(); try byte bb=coname.getbytes(iso-8859-1); coname=new string(bb,gb

25、2312); catch(exception e) public string getconame() return coname; public string getdeleteresultbycname() string condition=delete from class where cname= +cname+; deleteresultbycname=f(condition); return deleteresultbycname; public string getdeleteresultbydname() string condition=delete from class w

26、here dname= +dname+; deleteresultbydname=f(condition); return deleteresultbydname; public string getdeleteresultbyconame() string condition=delete from class where dname= +coname+; deleteresultbyconame=f(condition); return deleteresultbyconame; public string f(string condition) string delcondition=c

27、ondition; string str=; connection con; statement sql; try con=drivermanager.getconnection(jdbc:odbc:jsp_oracle,lal,lal); sql=con.createstatement(); int m=sql.executeupdate(delcondition); if(m!=0) str=對表中刪除+m+條記錄成功; else str=必須指定刪除記錄; con.close(); catch(sqlexception e) str=班級不存在; return str; renewbea

28、n.java /更新班級信息package tom.jiafei;import java.sql.*;public class renewbean string cname=, /班級名 dname=, /專業(yè)名 coname=; /學(xué)院名 string renewmessage=; public renewbean() try class.forname(sun.jdbc.odbc.jdbcodbcdriver); catch(classnotfoundexception e) public void setcname(string s) cname=s.trim(); try byte b

29、b=cname.getbytes(iso-8859-1); cname=new string(bb,gb2312); catch(exception e) public void setdname(string s) dname=s.trim(); try byte bb=dname.getbytes(iso-8859-1); dname=new string(bb,gb2312); catch(exception e) public void setconame(string s) coname=s.trim(); try byte bb=coname.getbytes(iso-8859-1

30、); coname=new string(bb,gb2312); catch(exception e) public string getrenewmessage() string updatecondition=update class set dname = +dname+ , coname = +coname+ where cname= +cname+; string str=; connection con; statement sql; try con=drivermanager.getconnection(jdbc:odbc:jsp_oracle,lal,lal); sql=con

31、.createstatement(); int m=sql.executeupdate(updatecondition); if(m!=0) str=對表中第+m+條記錄更新成功; else str=更新失敗; con.close(); catch(sqlexception e) str=你還沒有提交更新的數(shù)據(jù)或+e; return str; conditionquery.java /按不同字段查詢班級信息 package tom.jiafei;import java.sql.*;public class conditionquery string cname ; /學(xué)號 string dna

32、me; /系名 string coname; stringbuffer queryresultbycname, /查詢結(jié)果 queryresultbydname, queryresultbyconame; public conditionquery() queryresultbycname=new stringbuffer(); queryresultbydname=new stringbuffer(); queryresultbyconame=new stringbuffer(); try class.forname(sun.jdbc.odbc.jdbcodbcdriver); catch(

33、classnotfoundexception e) public void setcname(string s) cname=s.trim(); try byte bb=cname.getbytes(iso-8859-1); cname=new string(bb,gb2312); catch(exception e) public string getcname() return cname; public void setdname(string s) dname=s.trim(); try byte bb=dname.getbytes(iso-8859-1); dname=new str

34、ing(bb,gb2312); catch(exception e) public string getdname() return dname; public void setconame(string s) coname=s.trim(); try byte bb=coname.getbytes(iso-8859-1); coname=new string(bb,gb2312); catch(exception e) public string getconame() return coname; public stringbuffer getqueryresultbycname() st

35、ring condition=select * from class where cname= +cname+; queryresultbycname=f(condition); return queryresultbycname; public stringbuffer getqueryresultbydname() string condition=select * from class where dname= +dname+; queryresultbydname=f(condition); return queryresultbydname; public stringbuffer getqueryresultby

溫馨提示

  • 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)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論