數(shù)據(jù)庫(kù)課程設(shè)計(jì)——班級(jí)事務(wù)管理系統(tǒng)修改_第1頁(yè)
數(shù)據(jù)庫(kù)課程設(shè)計(jì)——班級(jí)事務(wù)管理系統(tǒng)修改_第2頁(yè)
數(shù)據(jù)庫(kù)課程設(shè)計(jì)——班級(jí)事務(wù)管理系統(tǒng)修改_第3頁(yè)
數(shù)據(jù)庫(kù)課程設(shè)計(jì)——班級(jí)事務(wù)管理系統(tǒng)修改_第4頁(yè)
數(shù)據(jù)庫(kù)課程設(shè)計(jì)——班級(jí)事務(wù)管理系統(tǒng)修改_第5頁(yè)
已閱讀5頁(yè),還剩31頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、淮北廣播電視大學(xué)數(shù)據(jù)庫(kù)課程設(shè)計(jì)報(bào)告2010級(jí)計(jì)算機(jī)科學(xué)與技術(shù)專(zhuān)業(yè) 班題目 班級(jí)事務(wù)管理系統(tǒng) 學(xué)生 王亮 學(xué)號(hào) 指導(dǎo)教師 朱燕燕 2011年 10月18日目 錄第一章 數(shù)據(jù)庫(kù)設(shè)計(jì)內(nèi)容31.1.課程設(shè)計(jì)任務(wù)與要求31.1.1.任務(wù)31.1.2.設(shè)計(jì)要求31.1.3.運(yùn)行環(huán)境31.2需求分析31.2.1.數(shù)據(jù)需求3事物需求4關(guān)系模式41.3概念結(jié)構(gòu)設(shè)計(jì)51.3.1. E-R圖51.4.邏輯結(jié)構(gòu)設(shè)計(jì)6表結(jié)構(gòu)6數(shù)據(jù)庫(kù)設(shè)計(jì)及完整性約束81.4.3.數(shù)據(jù)庫(kù)用戶(hù)權(quán)限管理9第二章 應(yīng)用系統(tǒng)設(shè)計(jì)102.1.需求分析10數(shù)據(jù)需求10事物需求10關(guān)系模式10數(shù)據(jù)字典112.2.概念結(jié)構(gòu)設(shè)計(jì)132.3.詳細(xì)設(shè)計(jì)14流程

2、圖142.4.運(yùn)行界面15管理員登陸界面15管理員查詢(xún)、添加、修改、刪除學(xué)生基本信息表152.4.3.成績(jī)查詢(xún)、添加、刪除192.4.4.課程的查詢(xún)、添加、刪除212.4.5.學(xué)生詳細(xì)信息的查詢(xún)、添加、刪除232.4.6.普通用戶(hù)登錄界面262.4.7.個(gè)人事務(wù)管理登錄界面262.4.8.生活委員管理特殊權(quán)限272.4.9.個(gè)人事務(wù)事件管理界面31第三章 課程設(shè)計(jì)結(jié)語(yǔ)34參考文獻(xiàn)35第一章 數(shù)據(jù)庫(kù)設(shè)計(jì)內(nèi)容1.1.課程設(shè)計(jì)任務(wù)與要求1.1.1.任務(wù)班級(jí)事務(wù)管理系統(tǒng)問(wèn)題描述:班級(jí)管理信息系統(tǒng)的任務(wù)是收集、存儲(chǔ)、管理班級(jí)同學(xué)的相關(guān)信息,以及班級(jí)日常管理中的相關(guān)信息。為班級(jí)信息公開(kāi)、增進(jìn)同學(xué)交流了解服

3、務(wù),同時(shí)加強(qiáng)班級(jí)管理、提高班級(jí)管理與服務(wù)的效率和質(zhì)量。1.1.2.設(shè)計(jì)要求、實(shí)現(xiàn)用戶(hù)登錄。、實(shí)現(xiàn)管理員管理班級(jí)事務(wù)。(學(xué)生信息、成績(jī)、課程、詳細(xì)信息的增、刪、改、查)、實(shí)現(xiàn)學(xué)生成績(jī)查詢(xún)。、實(shí)現(xiàn)個(gè)人事務(wù)管理。、實(shí)現(xiàn)生活委員班費(fèi)管理。1.1.3.運(yùn)行環(huán)境WindowsXP、SQL Server5.0、Myeclipse6.0、T、IE 瀏覽器、JDK1.2需求分析1.2.1.數(shù)據(jù)需求班級(jí)事務(wù)管理系統(tǒng)需要完成功能主要有:學(xué)生基本信息的輸入,包括學(xué)號(hào)、姓名、擔(dān)任職務(wù)等。學(xué)生基本信息的添加、查詢(xún)、修改、刪除,包括學(xué)生學(xué)號(hào)、姓名、職務(wù)、角色等。學(xué)生成績(jī)的添加、查詢(xún)、修改、刪除,包括學(xué)號(hào)、課程號(hào)、分?jǐn)?shù)。課程

4、的添加、刪除,包括課程號(hào)、課程名、學(xué)分、任課老師。生活委員對(duì)班費(fèi)的管理,包括班費(fèi)的收入、支出。個(gè)人對(duì)本人事務(wù)的管理,包括時(shí)間和事件。1.2.2事物需求管理員對(duì)學(xué)生事務(wù)管理部分,要求:a、可以查詢(xún)學(xué)生基本、詳細(xì)信息、課程信息以及成績(jī)。b、可以對(duì)學(xué)生基本信息、詳細(xì)信息進(jìn)行添加、修改及刪除操作。c、可以對(duì)課程信息進(jìn)行添加、刪除操作。d、可以對(duì)學(xué)生成績(jī)進(jìn)行添加、刪除操作。生活委員對(duì)班費(fèi)的管理,要求:a、可以查詢(xún)班費(fèi)收入支出的詳細(xì)信息。b、可以對(duì)班費(fèi)信息進(jìn)行添加、修改、刪除操作。1.2.3關(guān)系模式學(xué)生用戶(hù)表(學(xué)號(hào)、姓名、密碼、擔(dān)任職務(wù)、角色)課程表(課程號(hào)、課程名、學(xué)分、任課老師)成績(jī)表(主鍵、學(xué)號(hào)、課

5、程號(hào)、成績(jī))學(xué)生詳細(xì)信息表(id、學(xué)生學(xué)號(hào)、出生日期、身份證號(hào)碼、家庭往址、宿舍號(hào)、銀行卡號(hào))生活委員事物表(ID、時(shí)間、活動(dòng)地點(diǎn)、活動(dòng)人數(shù)、消費(fèi)前班費(fèi)余額、消費(fèi)金額、消費(fèi)后班費(fèi)余額、活動(dòng)意義、活動(dòng)結(jié)果)其它管理頁(yè)面(ID、時(shí)間、內(nèi)容、結(jié)果)1.3概念結(jié)構(gòu)設(shè)計(jì). E-R圖擔(dān)任職務(wù)密碼學(xué)號(hào)角色姓名角色姓名ID密碼ID成績(jī)管理家庭住址出生日期學(xué)號(hào)ID身份證號(hào)銀行卡號(hào)學(xué)生詳細(xì)信息查詢(xún)管理學(xué)生基本信息管理員生活委員事務(wù)管理課程名課程管理管理角色密碼姓名學(xué)生分?jǐn)?shù)課程號(hào)學(xué)號(hào)事件時(shí)間查詢(xún)總余額人數(shù)消費(fèi)金額地點(diǎn)結(jié)果個(gè)人事務(wù)管理結(jié)果課程號(hào)時(shí)間ID意義ID任課老師學(xué)分1.4.邏輯結(jié)構(gòu)設(shè)計(jì)1.4.1表結(jié)構(gòu)1.4.2

6、數(shù)據(jù)庫(kù)設(shè)計(jì)及完整性約束學(xué)生用戶(hù)表:create table user(id int auto_increment primary key,username varchar(10),userpass varchar(20),userjob varchar(10),userrole varchar(10)課程表:create table course(id int auto_increment primary key,cname varchar(20),ccredit int,cteacher varchar(20)成績(jī)表:create table Sc(id int auto_increment

7、 primary key,uid int,cid int,sgrade varchar(5)ALTER TABLE Sc ADD CONSTRAINT fk_Sc_uid FOREIGN KEY(uid) REFERENCES user(id);ALTER TABLE Sc ADD CONSTRAINT fk_Sc_cid FOREIGN KEY(cid) REFERENCES course(id);學(xué)生詳細(xì)信息表:create table stuinfo(id int auto_increment primary key,stuid int,stubirth varchar(20),stui

8、dentity varchar(30),stuaddr varchar(200),studorm varchar(20),stucard varchar(20)ALTER TABLE stuinfo ADD CONSTRAINT fk_stuinfo_stuid FOREIGN KEY(stuid) REFERENCES user(id);生活委員事物表:create table shwy(id int auto_increment primary key,time varchar(20),addr varchar(100),stunum int ,startmoney decimal,exp

9、ense decimal,endmoney decimal,actmeaning text,actresult varchar(10)其它管理頁(yè)面:create table qita(id int auto_increment primary key,qtime varchar(20),qcontent text,qresult varchar(20)1.4.3.數(shù)據(jù)庫(kù)用戶(hù)權(quán)限管理該系統(tǒng)設(shè)置三種類(lèi)型的用戶(hù)(1)管理員(admin) 即系統(tǒng)管理員擁有對(duì)學(xué)生基本信息、詳細(xì)信息、成績(jī)、課程的管理權(quán)限。(2)生活委員(shwy) 可以對(duì)班級(jí)班費(fèi)收入支出的詳細(xì)信息進(jìn)行管理;(3)其他個(gè)人(qita)對(duì)個(gè)

10、人事務(wù)事件進(jìn)行管理。第二章 應(yīng)用系統(tǒng)設(shè)計(jì)2.1.需求分析2.1.1數(shù)據(jù)需求班級(jí)事務(wù)管理系統(tǒng)需要完成功能主要有:學(xué)生基本信息的輸入,包括學(xué)號(hào)、姓名、擔(dān)任職務(wù)等。學(xué)生基本信息的添加、查詢(xún)、修改、刪除,包括學(xué)生學(xué)號(hào)、姓名、職務(wù)、角色等。學(xué)生成績(jī)的添加、查詢(xún)、修改、刪除,包括學(xué)號(hào)、課程號(hào)、分?jǐn)?shù)。課程的添加、刪除,包括課程號(hào)、課程名、學(xué)分、任課老師。生活委員對(duì)班費(fèi)的管理,包括班費(fèi)的收入、支出。個(gè)人對(duì)本人事務(wù)的管理,包括時(shí)間和事件。2.1.2事物需求管理員對(duì)學(xué)生事務(wù)管理部分,要求:a、可以查詢(xún)學(xué)生基本、詳細(xì)信息、課程信息以及成績(jī)。b、可以對(duì)學(xué)生基本信息、詳細(xì)信息進(jìn)行添加、修改及刪除操作。c、可以對(duì)課程信息

11、進(jìn)行添加、刪除操作。d、可以對(duì)學(xué)生成績(jī)進(jìn)行添加、刪除操作。生活委員對(duì)班費(fèi)的管理,要求:a、可以查詢(xún)班費(fèi)收入支出的詳細(xì)信息。b、可以對(duì)班費(fèi)信息進(jìn)行添加、修改、刪除操作。2.1.3關(guān)系模式學(xué)生用戶(hù)表(學(xué)號(hào)、姓名、密碼、擔(dān)任職務(wù)、角色)課程表(課程號(hào)、課程名、學(xué)分、任課老師)成績(jī)表(主鍵、學(xué)號(hào)、課程號(hào)、成績(jī))學(xué)生詳細(xì)信息表(id、學(xué)生學(xué)號(hào)、出生日期、身份證號(hào)碼、家庭往址、宿舍號(hào)、銀行卡號(hào))生活委員事物表(ID、時(shí)間、活動(dòng)地點(diǎn)、活動(dòng)人數(shù)、消費(fèi)前班費(fèi)余額、消費(fèi)金額、消費(fèi)后班費(fèi)余額、活動(dòng)意義、活動(dòng)結(jié)果)其它管理頁(yè)面(ID、時(shí)間、內(nèi)容、結(jié)果)2.1.5數(shù)據(jù)字典 為了使各數(shù)據(jù)流,數(shù)據(jù)處理過(guò)程,存儲(chǔ)過(guò)程不能反映

12、其中的數(shù)據(jù)成,數(shù)據(jù)項(xiàng)目,數(shù)據(jù)特性,所以用數(shù)據(jù)字典來(lái)對(duì)數(shù)據(jù)流圖中的各成份進(jìn)行具體的定義,為系統(tǒng)的分析,設(shè)計(jì)及以后的實(shí)現(xiàn)提供供有關(guān)元素一致性定義和詳細(xì)的描述:數(shù)據(jù)流字典數(shù)據(jù)流名稱(chēng):管理員登錄(P3) 來(lái)源:管理員去向:查詢(xún)學(xué)生基本信息數(shù)據(jù)組成:姓名+密碼+登錄權(quán)限數(shù)據(jù)流名稱(chēng):學(xué)生個(gè)人登錄 來(lái)源:個(gè)人去向:查詢(xún)個(gè)人信息數(shù)據(jù)組成:姓名+密碼+登錄權(quán)限數(shù)據(jù)流名稱(chēng):生活委員登錄 來(lái)源:生活委員去向:班費(fèi)管理數(shù)據(jù)組成:姓名+密碼+登錄權(quán)限數(shù)據(jù)流名稱(chēng):所有學(xué)生基本信息查詢(xún) 來(lái)源:管理員去向: 查詢(xún)處理過(guò)程數(shù)據(jù)組成:學(xué)號(hào)|姓名|密碼|擔(dān)任職務(wù)|角色數(shù)據(jù)流名稱(chēng):所有學(xué)生詳細(xì)信息查詢(xún) 來(lái)源:管理員去向: 查詢(xún)處理過(guò)

13、程數(shù)據(jù)組成:學(xué)生學(xué)號(hào)|出生日期|身份證號(hào)碼|家庭往址|宿舍號(hào)|銀行卡號(hào)數(shù)據(jù)流名稱(chēng):成績(jī)和課程查詢(xún)來(lái)源:學(xué)生去向:查詢(xún)處理過(guò)程數(shù)據(jù)組成:主鍵|學(xué)號(hào)|課程號(hào)|成績(jī)數(shù)據(jù)流名稱(chēng):班費(fèi)管理查詢(xún)來(lái)源:生活委員去向:查詢(xún)處理過(guò)程(P3)數(shù)據(jù)組成:ID|時(shí)間|活動(dòng)地點(diǎn)|活動(dòng)人數(shù)|消費(fèi)前班費(fèi)余額|消費(fèi)金額|消費(fèi)后班費(fèi)余額|活動(dòng)意義|活動(dòng)結(jié)果數(shù)據(jù)流名稱(chēng):個(gè)人事務(wù)查詢(xún)來(lái)源:學(xué)生去向:查詢(xún)處理過(guò)程數(shù)據(jù)組成:ID|時(shí)間|內(nèi)容|結(jié)果2.2.概念結(jié)構(gòu)設(shè)計(jì)班費(fèi)管理個(gè)人事務(wù)管理個(gè)人事務(wù)管理課程管理成績(jī)管理詳細(xì)信息管理基本信息管理生活委員管理班費(fèi)事宜管理員管理班級(jí)事務(wù)班級(jí)事務(wù)管理系統(tǒng)2.3.詳細(xì)設(shè)計(jì)流程圖更新頁(yè)面刪除刪除添加頁(yè)面

14、查詢(xún)基本信息添加頁(yè)面詳細(xì)信息查詢(xún)管理員查詢(xún)?nèi)砍煽?jī)登錄添加頁(yè)面添加頁(yè)面刪除普通用戶(hù)添加頁(yè)面刪除個(gè)人事務(wù)管理頁(yè)面事務(wù)登錄界面班費(fèi)管理頁(yè)面添加頁(yè)面刪除更新頁(yè)面成績(jī)查詢(xún)個(gè)人頁(yè)面刪除課程查詢(xún)2.4.運(yùn)行界面管理員登陸界面管理員查詢(xún)、添加、修改、刪除學(xué)生基本信息表程序代碼說(shuō)明package .dao;import java.io.UnsupportedEncodingException;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLExce

15、ption;import java.util.LinkedList;import java.util.List;import .bean.UserBean;import .util.DBConnection;public class StudentDao public List queryAllStudent()List list = new LinkedList();Connection conn = DBConnection.getConnection();try PreparedStatement ps = conn.prepareStatement("select * fro

16、m user");ResultSet rs = ps.executeQuery();while (rs.next() UserBean student = new UserBean();student.setId(rs.getInt("id");student.setUsername(rs.getString("username");student.setUserpass(rs.getString("userpass");student.setUserjob(rs.getString("userjob")

17、;student.setUserrole(rs.getString("userrole");list.add(student); catch (SQLException e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) e.printStackTrace();return list;public UserBean queryById(int id)Connection conn = DBConnection.getConnection();UserBean student=null;

18、try PreparedStatement ps = conn.prepareStatement("select * from user where id=?");ps.setInt(1, id);ResultSet rs = ps.executeQuery();while (rs.next() student = new UserBean();student.setId(rs.getInt("id");student.setUsername(rs.getString("username");student.setUserpass(r

19、s.getString("userpass");student.setUserjob(rs.getString("userjob");student.setUserrole(rs.getString("userrole"); catch (SQLException e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) e.printStackTrace();return student;public int updateStuInfo(UserBe

20、an stu)Connection conn = DBConnection.getConnection();UserBean student=null;int flag=0;try PreparedStatement ps = conn.prepareStatement("update user set username=?,userpass=?,userjob=?,userrole=? where id=?");ps.setString(1,stu.getUsername() );ps.setString(2,stu.getUserpass() );ps.setStrin

21、g(3,stu.getUserjob();ps.setString(4,stu.getUserrole() );ps.setInt(5, stu.getId();flag= ps.executeUpdate(); catch (SQLException e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) e.printStackTrace();return flag;public int deleteInfo(int id)Connection conn = DBConnection.getConnect

22、ion();UserBean lb=null;int flag=0;try PreparedStatement ps = conn.prepareStatement("delete from user where id=?");ps.setInt(1, id);flag= ps.executeUpdate(); catch (SQLException e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) e.printStackTrace();return flag;public int

23、 addStudentInfo(UserBean ub) int flag = 0;Connection conn = DBConnection.getConnection();PreparedStatement ps;String username=ub.getUsername();try username=new String(username.getBytes("ISO-8859-1"),"UTF-8"); catch (UnsupportedEncodingException e1) e1.printStackTrace();try ps = c

24、onn.prepareStatement("insert into user(username,userpass,userjob,userrole) values(?,?,?,?)");ps.setString(1, ub.getUsername();ps.setString(2, ub.getUserpass();ps.setString(3,ub.getUserjob();ps.setString(4, ub.getUserrole();flag=ps.executeUpdate();conn.close(); catch (SQLException e) e.prin

25、tStackTrace();return flag;.成績(jī)查詢(xún)、添加、刪除程序代碼說(shuō)明:package .dao;import java.io.UnsupportedEncodingException;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import java.util.LinkedList;import java.util.List;import .bean.CoursBean;import .be

26、an.ScBean;import .bean.UserBean;import .util.DBConnection;public class ScDao public List queryAllSc()List list = new LinkedList();Connection conn = DBConnection.getConnection();try PreparedStatement ps = conn.prepareStatement("select * from sc");ResultSet rs = ps.executeQuery();while (rs.n

27、ext() ScBean scb= new ScBean();scb.setId(rs.getInt("id");scb.setUid(rs.getInt("uid");scb.setCid(rs.getInt("cid");scb.setSgrade(rs.getString("sgrade");list.add(scb); catch (SQLException e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) e.pr

28、intStackTrace();return list;public int deleteScInfo(int id)Connection conn = DBConnection.getConnection();ScBean lb=null;int flag=0;try PreparedStatement ps = conn.prepareStatement("delete from sc where id=?;");ps.setInt(1, id);flag= ps.executeUpdate(); catch (SQLException e) e.printStackT

29、race();finallytry conn.close(); catch (SQLException e) e.printStackTrace();return flag;public int addScInfo(ScBean ub) int flag = 0;Connection conn = DBConnection.getConnection();PreparedStatement ps;try ps = conn.prepareStatement("insert into sc(uid,cid,sgrade) values(?,?,?)");ps.setInt(1

30、, ub.getUid();ps.setInt(2, ub.getCid();ps.setString(3,ub.getSgrade();flag=ps.executeUpdate();conn.close(); catch (SQLException e) e.printStackTrace();return flag;.課程的查詢(xún)、添加、刪除程序代碼說(shuō)明:package .dao;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQL

31、Exception;import java.util.LinkedList;import java.util.List;import .bean.CoursBean;import .bean.ScBean;import .util.DBConnection;public class CourseDao public List queryAllCourse()List list = new LinkedList();Connection conn = DBConnection.getConnection();try PreparedStatement ps = conn.prepareState

32、ment("select * from course");ResultSet rs = ps.executeQuery();while (rs.next() CoursBean scb= new CoursBean();scb.setId(rs.getInt("id");scb.setCname(rs.getString("cname");scb.setCcredit(rs.getInt("ccredit");scb.setCteacher(rs.getString("cteacher");li

33、st.add(scb); catch (SQLException e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) e.printStackTrace();return list;public int deleteCourseInfo(int id)Connection conn = DBConnection.getConnection();ScBean lb=null;int flag=0;try PreparedStatement ps = conn.prepareStatement("d

34、elete from course where id=?;");ps.setInt(1, id);flag= ps.executeUpdate(); catch (SQLException e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) e.printStackTrace();return flag;public int addCourseInfo(CoursBean cb) int flag = 0;Connection conn = DBConnection.getConnection(

35、);PreparedStatement ps;try ps = conn.prepareStatement("insert into course(cname,ccredit,cteacher) values(?,?,?)");ps.setString(1, cb.getCname();ps.setInt(2, cb.getCcredit();ps.setString(3,cb.getCteacher();flag=ps.executeUpdate();conn.close(); catch (SQLException e) e.printStackTrace();retu

36、rn flag;.學(xué)生詳細(xì)信息的查詢(xún)、添加、刪除程序代碼說(shuō)明:package .dao;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import java.util.LinkedList;import java.util.List;import .bean.StuInfoBean;import .util.DBConnection;public class StuInfoDao public List que

37、ryAllStuInfo()List list = new LinkedList();Connection conn = DBConnection.getConnection();try PreparedStatement ps = conn.prepareStatement("select * from stuinfo");ResultSet rs = ps.executeQuery();while (rs.next() StuInfoBean sfb= new StuInfoBean();sfb.setId(rs.getInt("id");sfb.s

38、etId(rs.getInt("stuid");sfb.setStubirth(rs.getString("stubirth");sfb.setStuidentity(rs.getString("stuidentity");sfb.setStuaddr(rs.getString("stuaddr");sfb.setStudorm(rs.getString("studorm");sfb.setStucard(rs.getString("stucard");list.add(sf

39、b); catch (SQLException e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) e.printStackTrace();return list;/管理員刪除學(xué)生詳細(xì)信息public int deleteStuInfo(int id)Connection conn = DBConnection.getConnection();StuInfoBean lb=null;int flag=0;try PreparedStatement ps = conn.prepareStatement(&q

40、uot;delete from stuinfo where id=?;");ps.setInt(1, id);flag= ps.executeUpdate(); catch (SQLException e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) e.printStackTrace();return flag;/添加學(xué)生詳細(xì)信息public int addStuInfo(StuInfoBean cb) int flag = 0;Connection conn = DBConnection.

41、getConnection();PreparedStatement ps;try ps = conn.prepareStatement("insertintostuinfo(stuid,stubirth,stuidentity,stuaddr,studorm,stucard) values(?,?,?,?,?,?)");ps.setInt(1, cb.getStuid();ps.setString(2, cb.getStubirth();ps.setString(3, cb.getStuidentity();ps.setString(4,cb.getStuaddr();ps

42、.setString(5, cb.getStudorm();ps.setString(6,cb.getStucard();flag=ps.executeUpdate();conn.close(); catch (SQLException e) e.printStackTrace();return flag;2.4.6.普通用戶(hù)登錄界面2.4.7.個(gè)人事務(wù)管理登錄界面2.4.8.生活委員管理特殊權(quán)限程序代碼說(shuō)明:package .dao;import java.sql.Connection;import java.sql.PreparedStatement;import java.sql.Res

43、ultSet;import java.sql.SQLException;import java.util.LinkedList;import java.util.List;import .bean.ShwyBean;import .util.DBConnection;public class ActivityDao public List queryAllActivity()List list = new LinkedList();Connection conn = DBConnection.getConnection();try PreparedStatement ps = conn.pre

44、pareStatement("select * from shwy");ResultSet rs = ps.executeQuery();while (rs.next() ShwyBean scb= new ShwyBean();scb.setId(rs.getInt("id");scb.setTime(rs.getString("time");scb.setAddr(rs.getString("addr");scb.setStunum(rs.getInt("stunum");scb.setSt

45、artmoney(rs.getDouble("startmoney");scb.setExpense(rs.getDouble("expense");scb.setEndmoney(rs.getDouble("endmoney");scb.setActmeaning(rs.getString("actmeaning");scb.setActresult(rs.getString("actresult");list.add(scb); catch (SQLException e) e.printS

46、tackTrace();finallytry conn.close(); catch (SQLException e) e.printStackTrace();return list;public int deleteArrInfo(int id)Connection conn = DBConnection.getConnection();ShwyBean lb=null;int flag=0;try PreparedStatement ps = conn.prepareStatement("delete from shwy where id=?");ps.setInt(1

47、, id);flag= ps.executeUpdate(); catch (SQLException e) e.printStackTrace();finallytry conn.close(); catch (SQLException e) e.printStackTrace();return flag;public int addArrInfo(ShwyBean cb) int flag = 0;Connection conn = DBConnection.getConnection();PreparedStatement ps;try ps = conn.prepareStatemen

48、t("insertintoshwy(time,addr,stunum,startmoney,expense,endmoney,actmeaning,actresult) values(?,?,?,?,?,?,?,?)");ps.setString(1, cb.getTime();ps.setString(2, cb.getAddr();ps.setInt(3, cb.getStunum();ps.setDouble(4, cb.getStartmoney();ps.setDouble(5,cb.getExpense();ps.setDouble(6,cb.getEndmon

49、ey();ps.setString(7,cb.getActmeaning();ps.setString(8,cb.getActresult();flag=ps.executeUpdate();conn.close(); catch (SQLException e) e.printStackTrace();return flag;public ShwyBean queryById(int id)Connection conn = DBConnection.getConnection();ShwyBean sb=null;try PreparedStatement ps = conn.prepareStatement("select * from shwy where id=?");ps.setInt(1, id);ResultSet rs = ps.executeQuery();while (rs.next() sb = new ShwyBean();sb.setId(rs.getInt("id");sb.setTime(rs.getString("time");sb.setAddr(rs.getString("addr");sb.setStun

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 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ì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論