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

付费下载

下载本文档

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

文档简介

1、Oracle数据库课程设计题目学生考试管理系统班级11网工2班姓名 _马路瑶 _学号 _扌旨导老师 _杨超峰 _目录一、前言 . 2二、需求分析 . 3三、系统设计 .5四、数据库设计 .7五、编程步骤 . 19六、测试 .25七、课程设计总结 .33丿八、参考资料.34九、附录 . 34一、前言学生考试管理是一个学校必不可少的部分,随着计算机和计 算机知识的普及, 学生考试管理系统得到了更大的发展空间, 通过对 学生考试管理系统的开发,可以提高校务人员的工作效率。学生成绩管理是一个学校不可缺少的部分, 一个良好的学生成绩 管理系统应该能够为用户提供充足的信息和快捷的查询手段。 学生考 试管理

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

3、储量大、保密性好、寿命长、成本低等。这些优点能够极大地提高管理者管理的效率 ,也是学校走向科学化、 正规化管理 , 与世 界接轨的重要条件。因此,开发设计这样一套学生成考试理软件成为很有必要的事 情.二、需求分析1.功能需求1.学生基本信息及所选科目成绩的录入或导入。2.基本信息的查询(分系、班级;分科目)与修改。3.对每系或每班各科成绩进行分析(即求单科平均成绩、及格率 和优秀率);4.对所开课程的成绩分析(求其平均成绩,最高分和最低分);5.对学生考试成绩进行排名(单科按系别或班级进行排名,对每 一个班级,同一学期学生总体成绩进行排名,并显示各科成绩 信息)6.不及格情况的统计、导出、打印

4、2.系统需求该学生成绩管理系统采用 java 语言开发研制, JavaBean 作为 行为模型, servlet 作为响应服务器, DIV+CSS+javascript 设计网 页 ,oracle 作为数据存储。在完成用户需求同时,完成条件查询等功 能。针对学生成绩及其数据特点,可以全面实现对学生成绩的插入、 查询、修改、删除和输出等功能的计算机管理。它能使学生成绩数据 的工作人员从繁重的工作中解脱出来, 大大减轻了工作量, 减少人为 的工作失误, 全面提高学生成绩管理的效率, 从而使学校对于学生成 绩的管理水平和技术水平跃上一个新的台阶。3.系统开发环境1.开发语言: java+jsp2.开

5、发工具: IE ,Tomcat , jdk ,dreamweaver3.数据库: Oracle 10g4.文档编写工具: word5.服务器端运行环境: oracle 10g , Tomcat ,jdk6.客户端运行环境:浏览器三、系统设计1.功能模块2.系统流程图3.数据字典(1)数据存储数据表:用户表表组成:用户名,密码数 据 项:用户名数据类型: varchar数据长度: 50数 据 项:密码数据类型: varchar数据长度: 50(2)数据流定义:登陆名称:登陆简述:用户登陆系统数据来源:用户数据去向:用户表 数据组成:用户名 +密码四、数据库设计1.数据库结构设计院系表(CS)字段

6、名数据类型是否为空说明Cs_classVarchar2(50)Not null班级名(主键)Cs_deptVarchar2(50)Not null系别Cs_gradeVarchar2(50)Not null年级成绩表(gd)字段名数据类型是否为空说明Gd_stu _noVarchar2(15)Not null学号(联合主键、外键)Gd_sub_subjectVarchar2(50)Not null科目(联合主键、外键)Gd_gradeNumber(3)Not null成绩科目表(sub)字段名数据类型是否为空说明Sub_subjectVarchar2(50)Not null科目名(主键)Sub

7、_teacher_ nameVarchar2(10)任课老师名学生表(student )字段名数据类型是否为空说明Stu_noVarchar2(15)Not null学号(主键)Stu_n ameVarchar2(10)Not null学生名Stu_cs_classVarchar2(50)班级名(外键)Stu_sexVarchar(4)Not null性别(约束)Stu_birthdayVarchar2(50)出生日期Stu_pho neVarchar2(200)联系电话用户表(user_)字段名数据类型是否为空说明n ameVarchar2(50)Not null用户名(主键)PasswdV

8、archar2(50)notn ull密码2.实体联系图3.数据库源代码select usere nv(la nguage) from dual; shutdow n immediate startup mountALTER SY STEM ENABLE RESTRICTED SESSION;ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;ALTER SYSTEM SET AQ_TM_PROCESSES=0;ALTER DATABASE OPEN;/alter database character set INTERNAL_USE UTF8shutdown imm

9、ediatestartupcreate user xz identified by xz/grant dba to xz/conn xz/xz/set serveroutput oncreate table user_(name varchar(50) primary key,passwd varchar(50) not null)/insert into user_ values(xz,xz);/Commit/create table cs(cs_class varchar(50) primary key, cs_dept varchar(50) not null, cs_grade var

10、char(50) not null )/create table student(stu_no varchar(15) primary key, stu_name varchar(10) not null,/男 or stu_sex=referencesstu_sex varchar(4) not null check (stu_sex=女),stu_birthday varchar(50) , stu_phone varchar(50), stu_cs_class varchar(50), constraint class_fk foreign key(stu_cs_class)cs(cs_

11、class)on delete cascade)/create table sub( sub_subject varchar(50) primary key, sub_teacher_name varchar(10)constraintfk_gd_stu_no foreign key(gd_stu_no)referencescreate table gd( gd_stu_no varchar(15),gd_sub_subject varchar(50), gd_grade number(3) not null,primary key(gd_stu_no,gd_sub_subject), stu

12、dent(stu_no), constraint fk_gd_sub_subject foreign key(gd_sub_subject) references sub(sub_subject) create or replace procedure p_insert_stu(p_stu_no in %type,p_stu_name in %type, p_stu_sex in %type, p_stu_birthday in %type, p_stu_phone in %type,p_stu_cs_class in %type,s_state_values out number) asbe

13、gininsert into student(stu_no,stu_name,stu_sex ,stu_birthday,stu_phone,stu_cs_ class)values (p_stu_no,p_stu_name,p_stu_sex,p_stu_birthday,p_stu_phone,p _stu_cs_class);if sql%rowcount=1then s_state_values:=0;end if;exceptionwhen others then s_state_values:=1;commit;end ;/create or replace procedure c

14、_insert_stu( c_stu_no in %type,c_state_values out number)asbeginselect count(*) into c_state_values from student where stu_no=c_stu_no;end ;/create or replace procedure c_insert_stu_fk( c_cs_class in %type, c_state_values_fk out number) asbeginselect count(*) into c_state_values_fk from cs where cs_

15、class=c_cs_class;end ;/create or replace procedure p_insert_cs( p_cs_dept in %type, p_cs_grade in %type, p_cs_class in %type, s_state_values out number) asbegin insert into cs(cs_dept,cs_grade,cs_class) values(p_cs_dept, p_cs_grade, p_cs_class);if sql%rowcount=1then s_state_values:=0; end if;excepti

16、onwhen others then s_state_values:=1; commit;end ;/create or replace procedure c_insert_cs( c_cs_class in %type, c_state_values out number) asbegin select count(*) into c_state_values from cs where cs_class=c_cs_class;end ;/create or replace procedure p_insert_sub( p_sub_subject in %type, p_sub_teac

17、her_name in %type, s_state_values out number) as begininsert into sub(sub_subject,sub_teacher_name) values(p_sub_subject, p_sub_teacher_name); if sql%rowcount=1then s_state_values:=0;end if;exceptionwhen others then s_state_values:=1;commit;end;/create or replace procedure c_insert_sub( c_sub_subjec

18、t in %type, c_state_values out number) asbeginselect count(*) into c_state_values from sub where sub_subject=c_sub_subject; end ;/ create or replace procedure p_insert_gd( p_gd_stu_no in %type, p_gd_sub_subject in %type,p_gd_grade in %type, s_state_values out number) as begininsert into gd(gd_stu_no

19、,gd_sub_subject,gd_grade) values(p_gd_stu_no,p_gd_sub_subject,p_gd_grade);if sql%rowcount=1then s_state_values:=0;end if;exceptionwhen others then s_state_values:=1;then s_state_values:=2;end if;commit;end ;/create or replace procedure c_insert_gd( p_gd_stu_no in %type, p_gd_sub_subject in %type, c_

20、state_values out number) asbeginselect count(*) into c_state_values from ( select gd_stu_no from gdwhere gd_sub_subject=p_gd_sub_subje )where gd_stu_no=p_gd_stu_no;end ;/create or replace procedure c_insert_gd_fk1( c_stu_no in %type,c_state_values_fk1 out number)asbeginselect count(*) into c_state_v

21、alues_fk1 from student where stu_no=c_stu_no;end ;/create or replace procedure c_insert_gd_fk2( c_sub_subject in %type,c_state_values_fk2 out number) asbegin select count(*) into c_state_values_fk2 from sub where sub_subject=c_sub_subject; end ;/create or replace procedure p_select_stu_no_info( p_st

22、u_no in out %type, p_stu_name out %type, p_stu_sex out %type, p_stu_birthday out %type, p_stu_phone out %type, p_stu_cs_class out %type, p_cs_dept out %type, p_cs_grade out %type, c_state_values out number)intop_stu_no,p_stu_name,p_stu_sex,p_stu_birthday,as beginc_state_values:=0;select stu_no, stu_

23、name,stu_sex ,stu_birthday ,stu_phone ,stu_cs_class ,cs_dept ,cs_grade p_stu_phone, p_stu_cs_class, p_cs_dept, p_cs_grade from student, cs where stu_cs_class=cs_class and stu_no=p_stu_no; exceptionwhen NO_DATA_FOUND then c_state_values:=1;when others then c_state_values:=2;end ;create or replace pro

24、cedure p_select_stu_no_gd(p_stu_no in %type , cursor_gd out sys_refcursor)as beginopen cursor_gd forselect gd_sub_subject,gd_gradefrom gdwhere gd_stu_no=p_stu_no;end;/create or replace procedure p_select_stu_name( p_stu_name in %type ,cursor_stu out sys_refcursor, c_state_values out number) asbegin

25、c_state_values:=0;open cursor_stu for select stu_no, stu_name,stu_sex ,stu_birthday ,stu_phone ,stu_cs_class ,cs_dept ,cs_gradefrom student, cswhere stu_name=p_stu_name and stu_cs_class=cs_class;exceptionwhen others then c_state_values:=2;end;/create or replace procedure p_pm_sum(cursor_gd_sum out s

26、ys_refcursor)asbegin open cursor_gd_sum for select distinct sno,stu_name,sum from student,(select gd_stu_no as sno,sum(gd_grade) as sum from gdgroup by gd_stu_no)where stu_no=snoorder by sum desc;end;/ create or replace procedure p_pm_sub( p_gd_sub_subject in %type, cursor_gd_sub out sys_refcursor a

27、s begin open cursor_gd_sub for select gd_stu_no,stu_name,gd_gradefrom gd,student where gd_sub_subject=p_gd_sub_subject and stu_no=gd_stu_no order by gd_grade desc;end;create or replace procedure p_pm_class(p_stu_cs_class in %type,cursor_gd_class out sys_refcursor)as beginopen cursor_gd_class for sel

28、ect distinct sno,stu_name,sum from student,(select gd_stu_no as sno,sum(gd_grade) as sum from gdgroup by gd_stu_no)where stu_no=sno and stu_cs_class=p_stu_cs_classorder by sum desc;end;/create or replace procedure p_fx(cursor_fx out sys_refcursor)asbeginopen cursor_fx forselect gd_sub_subject,max(gd

29、_grade) as zuigao,min(gd_grade)as zuidi,avg(gd_grade) as pingjun,SUM(CASE WHEN gd_grade=60THEN 1 ELSE 0 END)/COUNT(*)*100 AS jigelv,SUM(CASE WHEN gd_grade=80 THEN 1 ELSE 0 END)/COUNT(*)*100 AS youxiulvfrom gdgroup by gd_sub_subject;end;/create or replace procedure p_bujige(cursor_bujige out sys_refc

30、ursor)asbeginopen cursor_bujige forselect gd_stu_no,gd_sub_subject,gd_grade from gd where gd_grade60;end;/create or replace procedure p_update_stu( p_stu_no in %type, p_stu_name in %type, p_stu_sex in %type, p_stu_birthday in %type, p_stu_phone in %type, p_stu_cs_class in %type, s_state_values out n

31、umber) asbeginupdate studentset stu_name=p_stu_name,stu_sex=p_stu_sex,stu_birthday=p_stu_bi rthday,stu_phone=p_stu_phone,stu_cs_class=p_stu_cs_class where stu_no=p_stu_no;if sql%rowcount=1then s_state_values:=0;end if;exceptionwhen others then s_state_values:=1; commit;beginend ;/create or replace p

32、rocedure p_delete_stu( p_stu_no in %type, s_state_values out number) asdelete from gd where gd_stu_no=p_stu_no;delete from student where stu_no=p_stu_no; s_state_values:=0;exceptionwhen others then s_state_values:=1;rollback; commit;end;/create or replace procedure p_update_gd( p_gd_stu_no in %type,

33、 p_gd_sub_subject in %type, p_gd_grade in %type, s_state_values out number) asupdate gd setgd_stu_no=p_gd_stu_no,gd_sub_subject=p_gd_sub_subject,gd_grgd_sub_subject=p_gd_sub_subject;if sql%rowcount=1then s_state_values:=0;end if;exceptionwhen others then s_state_values:=1;rollback;commit;end ;/creat

34、e or replace procedure p_delete_gd( p_gd_stu_no in %type,wherestu_no=p_gd_stu_noandandp_gd_sub_subject in %type, s_state_values out number)asbegindelete from gdwhere gd_stu_no=p_gd_stu_no gd_sub_subject=p_gd_sub_subject;if sql%rowcount=1then s_state_values:=0;end if;exceptionwhen others then s_state

35、_values:=1;rollback;commit;end ;/ create or replace procedure p_denglu( p_name in %type, p_passwd in %type, s_state_values out number ) as begin select count(*) into s_state_values from user_ where name=p_name and passwd=p_passwd; end;/create or replace procedure p_update_passwd( p_name in %type, p_

36、passwd in %type,s_state_values out numberasbeginupdate user_set passwd= p_passwdwhere name=p_name;if sql%rowcount=1then s_state_values:=0;end if;exceptionwhen others then s_state_values:=1;rollback;commit;end;/ create or replace procedure p_select_no( cursor_stu_no out sys_refcursor)asbeginopen curs

37、or_stu_no forselect stu_nofrom studentorder by stu_no;end;/create or replace procedure p_select_all(cursor_all out sys_refcursor)as beginopen cursor_all for select stu_no, stu_name,stu_sex ,stu_birthday ,stu_phone ,stu_cs_class ,cs_dept ,cs_gradefrom student, cswhere stu_cs_class=cs_classorder by st

38、u_no;end;/create or replace procedure p_select_count(myrowcount out number)asbeginselect count(*) into myrowcount from student;end;/五、编程步骤1. 连接数据库的 javabean由于在本系统的多个 JSP 页面中都需要访问数据库,因此使用一 个 JavaBean 来专门完成数据库的连接。把数据库连接封装在一个类 中,每次需要访问数据库是只需实例化这个类并利用类里面提供的共 有方法来完成连接即可。这样,既可以节省编码时间,也提高了代码 的利用率。模块描述负责完成与

39、数据库的连接.类的设计与实现(1)名称:(2)功能:负责完成与数据库的连接。构造方法设计1.3.1 方法定义: public jdbc()IPO 图输入:无。处理:加载驱动程序,若加载中出现异常,则显示异常描述信 息。输出:无。 程序清单:public class jdbc private static final String DB_NAME= xz;private static final String DB_PASSWORD=xz;private static final String DB_URLjdbc:oracle:thin:localhost:1521:orcl;static t

40、ry (); catch (ClassNotFoundException e) ();class not found!);1.3.2 方法定义: public getConnection()IPO 图输入:无。处理:创建驱动程序和指定数据库间的连接对象,建立语句对 象输出:无。 程序清单:(1)public static Connection getConnection()try return (DB_URL, DB_NAME, DB_PASSWORD); catch (SQLException e) ();return null;2. 登陆模块.模块描述提供用户登录、退出、修改密码功能。.

41、原文件定义名称:登陆页面功能 :系统登录页面,获取用户登录系统时的用户名和密码。(2)名称:登录处理页面。功能:主要负责读取用户在登录页面输入的用户名、密码,判断 是否为合法用户。若是合法用户,则将该用户的用户名写入到 session 中,并重定向到系统内部的功能页面;否则,重定向到,阻止该用户 进入系统。输入:用户在登录页面输入的信息 ( 用户名和密码 ) 。处理:连接数据库,调用存储过程 p_denglu ,传入参数 name、 password,接收存储过程返回值 s_state_values,如果返回值为 1 则为合法用户, 将该用户的用户名写入到 session 中,并重定向到系 统

42、主页面;否则,弹出错误警告用户名密码错误,重定向到,阻止该 用户进入系统。输出:根据验证结果重定向到不同页面。程序清单 :%Connection conn = ();String j_name=(j_name);String j_passwd=(j_passwd);CallableStatement cstmt1 = (call p_denglu(,);(1,j_name);(2,j_passwd);(3, ();int s_state_values=(3);if(s_state_values=1)(user_name,j_name);();else if(s_state_values=0)(

43、alert( 用户名密码错误! );=);();();III!);%(3)名称:用户退出页面功能:主要负责登录用户的退出功能,将退出系统的用户信息从 session 中清除掉。输入:无。处理 :清楚 session 中存储的一切信息输出:重定向到登录也页面。程序清单 :(4)名称:修改密码页面功能:主要负责登录用户的修改密码,将用户密码传给(5)名称:处理修改密码页面功能:主要负责登录用户的修改密码功能,首先验证两次输入的 新密码是否一致, 然后调用存储过程 p_denglu 验证原密码是否正确, 最后调用存储过程 p_update_passwd 修改密码。程序清单 :3. 控制面板模块(4)

44、. 模块描述提供信息录入、查询、修改、删除、成绩统计分析功能 . 原文件定义 源代码详见附件(1)名称:录入班级信息页面。 功能:录入班级信息。(2)名称:处理录入班级信息页面。 功能:录入班级信息。(3)名称:录入科目信息页面。 功能:录入科目信息。名称:处理录入科目信息页面(9)功能:录入科目信息(5)名称:录入学生信息页面。 功能:录入学生信息。(6)名称:处理录入学生信息页面。 功能:录入学生信息。(7) 名称:录入成绩信息选择科目页面 功能:录入成绩信息。(8)名称:录入成绩信息页面。功能:录入成绩信息。名称:处理录入成绩信息页面功能:录入成绩信息。(10)名称:通过学号查询信息页面。 功能:通过学号查询信息。(11) 名称:处理通过学号查询信息页面 功能:通过学号查询信息。(12)名称:通过姓名查询信息页面。 功能:通过姓名查询信息。(13) 名称:处理通过姓名查询信息页面 功能:通过姓名查询信息。(18)(14)名称:修改学生信息页面。功能:修改学生信息。(15)名称:处理修改学生信息页面功能:修改学生信息。(16)名称:修改成

温馨提示

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

评论

0/150

提交评论