学生考试管理系统Oracle数据库课程设计报告_第1页
学生考试管理系统Oracle数据库课程设计报告_第2页
学生考试管理系统Oracle数据库课程设计报告_第3页
学生考试管理系统Oracle数据库课程设计报告_第4页
学生考试管理系统Oracle数据库课程设计报告_第5页
已阅读5页,还剩33页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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用户

45、名密码错误!;location.hrefdenglu.jsp;cstmt1.close;conn.close;% 3tuichu.jsp 名称:用户退出页面 功能:主要负责登录用户的退出功能,将退出系统的用户信息从session中清除掉。输入:无。处理:清楚session中存储的一切信息 输出:重定向到登录也页面。 程序清单: % session.invalidate; response.sendredirectdenglu.jsp; % 4xg-mm.jsp 名称:修改密码页面 功能:主要负责登录用户的修改密码,将用户密码传给cl-xgmm.jsp。 5cl-xg-mm.jsp 名称:处理修

46、改密码页面 功能:主要负责登录用户的修改密码功能,首先验证两次输入的新密码是否一致,然后调用存储过程p_denglu验证原密码是否正确,最后调用存储过程p_update_passwd修改密码。 程序清单: % connection conn jdbc.getconnection; string j_namerequest.getparameterj_name; string j_passwdrequest.getparameterj_passwd; string j_passwd_new1request.getparameterj_passwd_new1; string j_passwd_ne

47、w2request.getparameterj_passwd_new2; ifj_passwd_new1.equalsj_passwd_new2 callablestatement cstmt1 conn.preparecallcall p_denglu?,?,?; cstmt1.setstring1,j_name; cstmt1.setstring2,j_passwd; cstmt1.registeroutparameter3,/.es.integer; cstmt1.execute; int s_state_valuescstmt1.getint3; ifs_state_values1 c

48、allablestatement cstmt2 conn.preparecallcall p_update_passwd?,?,?; cstmt2.setstring1,j_name; cstmt2.setstring2,j_passwd_new1; cstmt2.registeroutparameter3,/.es.integer; cstmt2.execute; int s_state_values2cstmt2.getint3; if s_state_values20 out.print恭喜你,密码修改成功!; else out.print密码修改失败!; else ifs_state_

49、values0 out.print原名密码错误!请重新填写; cstmt1.close; cstmt2.close; conn.close; else out.print两次输入的密码不一致,请重新输入!; %3.控制面板模块3.1.模块描述提供信息录入、查询、修改、删除、成绩统计分析功能。3.2.原文件定义 源代码详见附件 1lr-cs.jsp 名称:录入班级信息页面。 功能:录入班级信息。 2cl-lr-cs.jsp 名称:处理录入班级信息页面。 功能:录入班级信息。 3lr-sub.jsp 名称:录入科目信息页面。 功能:录入科目信息。 4cl-lr-sub.jsp 名称:处理录入科目信息页面。 功能:录入科目信息。 5lr-stu.jsp 名称:录入学生信息页面。 功能:录入学生信息。 6cl-lr-stu.jsp 名称:处理录入学生信息页面。 功能:录入学生信息。 7lr-gd-sub.jsp 名称:录入成绩信息选择科目页面。 功能:录入成绩信息。 8lr-gd.jsp 名称:录入成绩信息页面。 功能:录入成绩信息。 9cl-lr-stu.jsp 名称:处理录入成绩信息页面。 功能:录入成绩信息。 10cx-by-no.jsp 名称

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论