学生考试管理系统Oracle数据库课程设计报告.doc

上传人:laozhun 文档编号:2395314 上传时间:2023-02-17 格式:DOC 页数:38 大小:132KB
返回 下载 相关 举报
学生考试管理系统Oracle数据库课程设计报告.doc_第1页
第1页 / 共38页
学生考试管理系统Oracle数据库课程设计报告.doc_第2页
第2页 / 共38页
学生考试管理系统Oracle数据库课程设计报告.doc_第3页
第3页 / 共38页
学生考试管理系统Oracle数据库课程设计报告.doc_第4页
第4页 / 共38页
学生考试管理系统Oracle数据库课程设计报告.doc_第5页
第5页 / 共38页
点击查看更多>>
资源描述

《学生考试管理系统Oracle数据库课程设计报告.doc》由会员分享,可在线阅读,更多相关《学生考试管理系统Oracle数据库课程设计报告.doc(38页珍藏版)》请在三一办公上搜索。

1、学生考试管理系统-Oracle数据库课程设计报告 Oracle数据库课程设计 题目学生考试管理系统 班级 姓名 学号 指导老师 目录前言2需求分析3系统设计5数据库设计7编程步骤19测试25课程设计总结33参考资料34附录34一、前言 学生考试管理是一个学校必不可少的部分,随着计算机和计算机知识的普及,学生考试管理系统得到了更大的发展空间,通过对学生考试管理系统的开发,可以提高校务人员的工作效率。 学生成绩管理是一个学校不可缺少的部分,一个良好的学生成绩管理系统应该能够为用户提供充足的信息和快捷的查询手段。学生考试管理系统对学校加强学生考试管理有着极其重要的作用.由于各个大学都在持续扩招,学生

2、的数量日益庞大,对于如何管理如此庞大的学生考试数据显得更为复杂,传统的手工成绩管理不仅工作量大,而且容易出现问题,如:效率低、保密性差,另外时间一长,将产生大量的文件和数据,这对于查找、更新和维护都带来了不少的困难。已不能适应时代的发展。 随着科学技术的不断提高,计算机科学日渐成熟,其强大的功能已为人们深刻认识,它已进入人类社会的各个领域并发挥着越来越重要的作用。 作为计算机应用的一部分,使用计算机对学生成绩信息进行管理,具有手工管理所无法比拟的优点。例:检索迅速、查找方便、可靠性高、存储量大、保密性好、寿命长、成本低等。这些优点能够极大地提高管理者管理的效率,也是学校走向科学化、正规化管理,

3、与世界接轨的重要条件。 因此,开发设计这样一套学生成考试理软件成为很有必要的事情.二、需求分析1.功能需求学生基本信息及所选科目成绩的录入或导入。基本信息的查询(分系、班级;分科目)与修改。对每系或每班各科成绩进行分析(即求单科平均成绩、及格率和优秀率);对所开课程的成绩分析(求其平均成绩,最高分和最低分);对学生考试成绩进行排名(单科按系别或班级进行排名,对每一个班级,同一学期学生总体成绩进行排名,并显示各科成绩信息)不及格情况的统计、导出、打印2.系统需求 该学生成绩管理系统采用java语言开发研制, JavaBean作为行为模型,servlet作为响应服务器,DIV+CSS+javasc

4、ript设计网页,oracle作为数据存储。在完成用户需求同时,完成条件查询等功能。 针对学生成绩及其数据特点,可以全面实现对学生成绩的插入、查询、修改、删除和输出等功能的计算机管理。它能使学生成绩数据的工作人员从繁重的工作中解脱出来,大大减轻了工作量,减少人为的工作失误,全面提高学生成绩管理的效率,从而使学校对于学生成绩的管理水平和技术水平跃上一个新的台阶。3.系统开发环境1.开发语言:java+jsp2.开发工具: IE 8.0,Tomcat ,jdk 1.7,dreamweaver3.数据库:Oracle 10g4.文档编写工具:word5. 服务器端运行环境:oracle 10g,To

5、mcat ,jdk 1.76. 客户端运行环境:浏览器三、系统设计1.功能模块2.系统流程图3.数据字典1数据存储数据表:用户表表组成:用户名,密码数 据 项:用户名数据类型:varchar数据长度:50数 据 项:密码数据类型:varchar数据长度:502数据流定义:登陆名 称:登陆简 述:用户登陆系统数据来源:用户数据去向:用户表数据组成:用户名+密码四、数据库设计1.数据库结构设计院系表(cs)字段名数据类型是否为空说明Cs_classVarchar250Not null班级名(主键)Cs_deptVarchar250Not null系别Cs_gradeVarchar250Not nu

6、ll年级成绩表(gd)字段名数据类型是否为空说明Gd_stu_noVarchar215Not null学号(联合主键、外键)Gd_sub_subjectVarchar250Not null科目(联合主键、外键)Gd_gradeNumber3Not null成绩科目表(sub)字段名数据类型是否为空说明Sub_subjectVarchar250Not null科目名(主键)Sub_teacher_nameVarchar210任课老师名学生表(student)字段名数据类型是否为空说明Stu_noVarchar215Not null学号主键Stu_nameVarchar210Not null学生名

7、Stu_cs_classVarchar250班级名(外键)Stu_sexVarchar4Not null性别约束Stu_birthdayVarchar250出生日期Stu_phoneVarchar2(200)用户表(user_)字段名数据类型是否为空说明nameVarchar250Not null用户名主键PasswdVarchar250notnull密码2.实体联系图3.数据库源代码select userenvlanguage from dual;shutdown immediatestartup mountALTER SYSTEM ENABLE RESTRICTED SESSION;ALT

8、ER SYSTEM SET JOB_QUEUE_PROCESSES0;ALTER SYSTEM SET AQ_TM_PROCESSES0;ALTER DATABASE OPEN;alter database character set INTERNAL_USE UTF8;shutdown immediatestartupcreate user xz3 identified by xz/grant dba to xz/conn xz3/xz/set serveroutput on/create table user_name varchar50 primary key,passwd varcha

9、r50 not null/insert into user_ valuesxz,xz;/Commit/create table cscs_class varchar50 primary key,cs_dept varchar50 not null,cs_grade varchar50 not null/create table studentstu_no varchar15 primary key,stu_name varchar10 not null,stu_sex varchar4 not null check stu_sex男or stu_sex女, stu_birthday varch

10、ar50 ,stu_phone varchar50,stu_cs_class varchar50,constraint class_fk foreign keystu_cs_class references cscs_classon delete cascade/ create table subsub_subject varchar50 primary key,sub_teacher_name varchar10/ create table gdgd_stu_no varchar15,gd_sub_subject varchar50,gd_grade number3 not null,pri

11、mary keygd_stu_no,gd_sub_subject,constraint fk_gd_stu_no foreign keygd_stu_no references studentstu_no,constraint fk_gd_sub_subject foreign keygd_sub_subject references subsub_subject/create or replace procedure p_insert_stup_stu_no in student.stu_no%type,p_stu_name in student.stu_name%type,p_stu_se

12、x in student.stu_sex%type,p_stu_birthday in student.stu_birthday%type,p_stu_phone in student.stu_phone%type,p_stu_cs_class in student.stu_cs_class%type,s_state_values out numberasbegin insert into studentstu_no,stu_name,stu_sex ,stu_birthday,stu_phone,stu_cs_classvalues p_stu_no,p_stu_name,p_stu_sex

13、,p_stu_birthday,p_stu_phone,p_stu_cs_class;if sql%rowcount1then s_state_values:0;end if;exceptionwhen others then s_state_values:1;commit;end ;/create or replace procedure c_insert_stuc_stu_no in student.stu_no%type,c_state_values out numberasbeginselect count* into c_state_values from studentwhere

14、stu_noc_stu_no;end ;/create or replace procedure c_insert_stu_fkc_cs_class in cs.cs_class%type,c_state_values_fk out numberasbeginselect count* into c_state_values_fk from cswhere cs_classc_cs_class;end ;/create or replace procedure p_insert_csp_cs_dept in cs.cs_dept%type,p_cs_grade in cs.cs_grade%t

15、ype,p_cs_class in cs.cs_class%type,s_state_values out numberasbegininsert into cscs_dept,cs_grade,cs_classvaluesp_cs_dept, p_cs_grade, p_cs_class;if sql%rowcount1then s_state_values:0;end if;exceptionwhen others then s_state_values:1;commit;end ;/create or replace procedure c_insert_csc_cs_class in

16、cs.cs_class%type,c_state_values out numberasbeginselect count* into c_state_values from cswhere cs_classc_cs_class;end ;/create or replace procedure p_insert_subp_sub_subject in sub.sub_subject%type,p_sub_teacher_name in sub.sub_teacher_name%type,s_state_values out numberasbegininsert into subsub_su

17、bject,sub_teacher_namevaluesp_sub_subject, p_sub_teacher_name;if sql%rowcount1then s_state_values:0;end if;exceptionwhen others then s_state_values:1;commit;end;/create or replace procedure c_insert_subc_sub_subject in sub.sub_subject%type,c_state_values out numberasbeginselect count* into c_state_v

18、alues from subwhere sub_subjectc_sub_subject;end ;/create or replace procedure p_insert_gdp_gd_stu_no in gd.gd_stu_no%type,p_gd_sub_subject in gd.gd_sub_subject%type,p_gd_grade in gd.gd_grade%type,s_state_values out numberasbegininsert into gdgd_stu_no,gd_sub_subject,gd_gradevaluesp_gd_stu_no,p_gd_s

19、ub_subject,p_gd_grade;if sql%rowcount1then s_state_values:0;end if;exceptionwhen others then s_state_values:1;if p_gd_gradenullthen s_state_values:2;end if;commit;end ;/create or replace procedure c_insert_gdp_gd_stu_no in gd.gd_stu_no%type,p_gd_sub_subject in gd.gd_sub_subject%type,c_state_values o

20、ut numberasbeginselect count* into c_state_values from select gd_stu_no from gdwhere gd_sub_subjectp_gd_sub_subjectwhere gd_stu_nop_gd_stu_no;end ;/create or replace procedure c_insert_gd_fk1c_stu_no in student.stu_no%type,c_state_values_fk1 out numberasbeginselect count* into c_state_values_fk1 fro

21、m studentwhere stu_noc_stu_no;end ;/create or replace procedure c_insert_gd_fk2c_sub_subject in sub.sub_subject%type,c_state_values_fk2 out numberasbeginselect count* into c_state_values_fk2 from subwhere sub_subjectc_sub_subject;end ;/create or replace procedure p_select_stu_no_infop_stu_no in out

22、student.stu_no%type,p_stu_name out student.stu_name%type,p_stu_sex out student.stu_sex%type,p_stu_birthday out student.stu_birthday%type,p_stu_phone out student.stu_phone%type,p_stu_cs_class out student.stu_cs_class%type,p_cs_dept out cs.cs_dept%type,p_cs_grade out cs.cs_grade%type,c_state_values ou

23、t numberasbeginc_state_values:0;select stu_no, stu_name,stu_sex ,stu_birthday ,stu_phone ,stu_cs_class ,cs_dept ,cs_gradeinto p_stu_no, p_stu_name, p_stu_sex, p_stu_birthday, p_stu_phone, p_stu_cs_class, p_cs_dept, p_cs_gradefrom student, cswhere stu_cs_classcs_class and stu_nop_stu_no;exceptionwhen

24、 NO_DATA_FOUND then c_state_values:1;when others then c_state_values:2;end ;/create or replace procedure p_select_stu_no_gdp_stu_no in student.stu_no%type , cursor_gd out sys_refcursorasbeginopen cursor_gd forselect gd_sub_subject,gd_gradefrom gdwhere gd_stu_nop_stu_no;end;/create or replace procedu

25、re p_select_stu_namep_stu_name in student.stu_name%type ,cursor_stu out sys_refcursor,c_state_values out numberasbeginc_state_values:0;open cursor_stu forselect stu_no, stu_name,stu_sex ,stu_birthday ,stu_phone ,stu_cs_class ,cs_dept ,cs_grade from student, cswhere stu_namep_stu_name and stu_cs_clas

26、scs_class;exceptionwhen others then c_state_values:2;end;/create or replace procedure p_pm_sumcursor_gd_sum out sys_refcursorasbeginopen cursor_gd_sum forselect distinct sno,stu_name,sumfrom student,select gd_stu_no as sno,sumgd_grade as sum from gd group by gd_stu_nowhere stu_nosnoorder by sum desc

27、;end;/create or replace procedure p_pm_subp_gd_sub_subject in gd.gd_sub_subject%type,cursor_gd_sub out sys_refcursorasbeginopen cursor_gd_sub forselect gd_stu_no,stu_name,gd_gradefrom gd,studentwhere gd_sub_subjectp_gd_sub_subject and stu_nogd_stu_noorder by gd_grade desc;end;/create or replace proc

28、edure p_pm_classp_stu_cs_class in student.stu_cs_class%type,cursor_gd_class out sys_refcursorasbeginopen cursor_gd_class forselect distinct sno,stu_name,sumfrom student,select gd_stu_no as sno,sumgd_grade as sum from gd group by gd_stu_nowhere stu_nosno and stu_cs_classp_stu_cs_classorder by sum des

29、c;end;/create or replace procedure p_fxcursor_fx out sys_refcursorasbeginopen cursor_fx forselect gd_sub_subject,gd_grade as zuigao,mingd_grade as zuidi,avggd_grade as pingjun,SUMCASE WHEN gd_grade60 THEN 1 ELSE 0 END/COUNT*100 AS jigelv,SUMCASE WHEN gd_grade80 THEN 1 ELSE 0 END/COUNT*100 AS youxiul

30、vfrom gdgroup by gd_sub_subject;end;/create or replace procedure p_bujigecursor_bujige out sys_refcursorasbeginopen cursor_bujige forselect gd_stu_no,gd_sub_subject,gd_gradefrom gdwhere gd_grade60;end;/create or replace procedure p_update_stup_stu_no in student.stu_no%type,p_stu_name in student.stu_

31、name%type,p_stu_sex in student.stu_sex%type,p_stu_birthday in student.stu_birthday%type,p_stu_phone in student.stu_phone%type,p_stu_cs_class in student.stu_cs_class%type,s_state_values out numberasbeginupdate studentset stu_namep_stu_name,stu_sexp_stu_sex,stu_birthdayp_stu_birthday,stu_phonep_stu_ph

32、one,stu_cs_classp_stu_cs_classwhere stu_nop_stu_no;if sql%rowcount1then s_state_values:0;end if;exceptionwhen others then s_state_values:1;commit;end ;/create or replace procedure p_delete_stup_stu_no in student.stu_no%type,s_state_values out numberasbegindelete from gd where gd_stu_nop_stu_no;delet

33、e from student where stu_nop_stu_no;s_state_values:0;exceptionwhen others then s_state_values:1;rollback;commit;end;/create or replace procedure p_update_gdp_gd_stu_no in gd.gd_stu_no%type,p_gd_sub_subject in gd.gd_sub_subject%type,p_gd_grade in gd.gd_grade%type,s_state_values out numberasbeginupdat

34、e gd set gd_stu_nop_gd_stu_no,gd_sub_subjectp_gd_sub_subject,gd_gradep_gd_gradewhere gd_stu_nop_gd_stu_no and gd_sub_subjectp_gd_sub_subject;if sql%rowcount1then s_state_values:0;end if;exceptionwhen others then s_state_values:1;rollback;commit;end ;/create or replace procedure p_delete_gdp_gd_stu_n

35、o in gd.gd_stu_no%type,p_gd_sub_subject in gd.gd_sub_subject%type,s_state_values out numberasbegindelete from gdwhere gd_stu_nop_gd_stu_no and gd_sub_subjectp_gd_sub_subject;if sql%rowcount1then s_state_values:0;end if;exceptionwhen others then s_state_values:1;rollback;commit;end ;/create or replac

36、e procedure p_denglup_name in user_.name%type,p_passwd in user_.passwd%type,s_state_values out numberasbeginselect count* into s_state_valuesfrom user_where namep_name and passwdp_passwd;end;/create or replace procedure p_update_passwdp_name in user_.name%type,p_passwd in user_.passwd%type,s_state_v

37、alues out numberasbeginupdate user_ set passwd p_passwdwhere namep_name;if sql%rowcount1then s_state_values:0;end if;exceptionwhen others then s_state_values:1;rollback;commit;end;/create or replace procedure p_select_nocursor_stu_no out sys_refcursorasbeginopen cursor_stu_no forselect stu_no from s

38、tudentorder by stu_no;end;/create or replace procedure p_select_allcursor_all out sys_refcursorasbeginopen cursor_all forselect stu_no, stu_name,stu_sex ,stu_birthday ,stu_phone ,stu_cs_class ,cs_dept ,cs_grade from student, cswhere stu_cs_classcs_classorder by stu_no;end;/create or replace procedur

39、e p_select_countmyrowcount out number asbeginselect count* into myrowcountfrom student;end;/五、编程步骤1.连接数据库的javabean 由于在本系统的多个JSP页面中都需要访问数据库,因此使用一个JavaBean来专门完成数据库的连接。把数据库连接封装在一个类中,每次需要访问数据库是只需实例化这个类并利用类里面提供的共有方法来完成连接即可。这样,既可以节省编码时间,也提高了代码的利用率。 1.1模块描述 负责完成与数据库的连接 1.2.类的设计与实现 (1)名称:jdbc.java (2)功能:负责完

40、成与数据库的连接。 1.3构造方法设计 1.3.1 方法定义:public jdbc IPO图 输入:无。 处理:加载驱动程序,若加载中出现异常,则显示异常描述信息。 输出:无。 程序清单:public class jdbc private static final String DB_NAME xz3;private static final String DB_PASSWORDxz;private static final String DB_URL jdbc:oracle:thin:localhost:1521:orcl;static try Class.forName/.ver.Ora

41、cleDriver;catch ClassNotFoundException e e.printStackTrace;/.ntlnclass not found!;1.3.2 方法定义:public getConnection IPO图 输入:无。 处理:创建驱动程序和指定数据库间的连接对象,建立语句对象 输出:无。 程序清单:public static Connection getConnectiontry return DriverManager.getConnectionDB_URL, DB_NAME, DB_PASSWORD;catch SQLException e e.printSt

42、ackTrace;return null;2.登陆模块2.1.模块描述提供用户登录、退出、修改密码功能。2.2.原文件定义1denglu.jsp 名称:登陆页面。 功能:系统登录页面,获取用户登录系统时的用户名和密码。 2cl-denglu.jsp 名称:登录处理页面。 功能:主要负责读取用户在登录页面输入的用户名、密码,判断是否为合法用户。若是合法用户,则将该用户的用户名写入到session中,并重定向到系统内部的功能页面;否则,重定向到denglu.jsp,阻止该用户进入系统。输入:用户在登录页面输入的信息用户名和密码。 处理:连接数据库,调用存储过程p_denglu,传入参数name、p

43、assword,接收存储过程返回值s_state_values,如果返回值为1则为合法用户,将该用户的用户名写入到session中,并重定向到系统主页面index.jsp;否则,弹出错误警告用户名密码错误,重定向到denglu.jsp,阻止该用户进入系统。输出:根据验证结果重定向到不同页面。程序清单:%Connection conn jdbc.getConnection; String j_namerequest.getParameterj_name;String j_passwdrequest.getParameterj_passwd;CallableStatement cstmt1 con

44、n.prepareCallcall p_denglu?,?,?;cstmt1.setString1,j_name;cstmt1.setString2,j_passwd;cstmt1.registerOutParameter3,/.es.INTEGER; cstmt1.execute;int s_state_valuescstmt1.getInt3;ifs_state_values1session.setAttributeuser_name,j_name;response.sendRedirectindex.jsp;else ifs_state_values0out.printlnalert用户名密码错误!;location.hrefdenglu.jsp;cstmt1.close;conn.close;% 3tuichu.jsp 名称:用户退出页面 功能:主要负责登录用户的退出功能,将退出系统的用户信息从session中清除掉。输入:无。处理:清楚session中存储的一切信息 输出:重定向到登录也页面。 程序清单: % session.invalidate; response.sendRedirectdenglu.jsp; % 4xg-mm.jsp 名称:

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号