1.绪论
一直以来学生的成续管理是学校工作中的一项重要内容,我国的大中专院校的学生成绩管理水平普遍不高。随着办学规模的护大和招生人数的增加,建立一个成绩维护系统是非常必要的。普通的成绩管理已不能适应时代的发展,因为它浪费了许多的人力和物力。在当今信息时代这种传统的管理方法必然被以计算机为基础的信息管理系统所代替。为了提高成绩管理的效率,我选择了学生成绩管理系统作为毕业设计的课题本系统在大多数成绩管理系统的基础上,主要增加了教师对成绩的操作,教师改完试卷后不用在往学院的教务处办公室报送成绩,可以直接的把成绩上传到网络上,学生也可以方
便快速的查询到自己的成绩,考试后教务管理人员也不必总呆在学院的办公室,他们都不受时间,位置,空间的限制,只要有上网的条件,在家里就可以完成有关成绩的录入,更新,管理,查询和删除。本系统将会改变以前靠手工管理学生成绩的状况,提高工作效率。希望能为老师和学校的工作带来便利。
建立学生成绩管理系统,采用计算机对学生成绩进行管理,进一步提高办学效益和现代化水平。帮助广大教师提高工作效率,实现学生成绩维护工作流程的系统化、规范化和自动化。为了使系统在学院的管理中发挥更大的作用,实现工作过程的计算机化,提高工作效率和工作质量,现提出如下的系统开发目标
(1)系统应具有实用性、可靠性和适用性,同时注意到先进性
(2)对各个数据库进行动态管理,防止混乱
(3)不同用户有不同的查询和修改权限,防止非法查询非法修改
(4)能够对查询结果进行分类汇总,实现报表打印和下载
(5)方便用户的操作,尽量减少用户的操作
随着高校办学规模的扩大和招生人数的增加,学生成绩管理维护是学校管理中异常重要的一个环节,作为学校,除了育人,就是育知,学生成绩管理的计算机化是整个学校教务管理中的重要一部分,介于它的重要性,学生成绩管興系統的开发与应用就逐渐提入议程并占着越来越重要的份量。运用学生成绩管理维护系统可以减轻学院教学人员的工作量,缩小开支,提高工作效率与准确率,能够节省时间,学生也能够尽快的知道自己的考试成绩,投入新的课程的学习或复习这次没有考过的课程。而学生成绩管理系统的应用也为今天的民办教育在未来市场的竞争力有所提高。在现代高科技的飞跃发展,人们工作习惯的改变,特别是电脑的大量普及,人们生活节奏越来越快,怎样提高工作效率是人们首先考虑的问题。学生成绩管理是一个非常繁琐与复杂的一项工作,一个原因就是工作量大,不好管。对于一个学校而言,管理好学生的成绩,是非常重要的。因此开发出一套学生成绩管理系统是非常必要的。
2.系统需求分析与设计
2.1系统需求分析
利用计算机进行学生信息管理,不仅能够保证准确、无误、快速输出,而且还可以利用计算机对有关信息进行査询,检索迅速、查找方便、可靠性高、存储量大、保密性好。要科学地实现信息化管理,开发一个适合学校的,能够进行信息存储、查询、修改等功能的信息管理系统是十分重妻的。我这次的课题就是设与实现一个学生信息管理系统
2.2 系统设计
以下是学生信息管理系统功能模块关系图,主要包含、添加、修改、删除、学生信息等功能。
3.数据库设计
3.1数据库需求分析
java数据库课程设计之学生信息管理系统,利用java数据库的实现对学生信息的管理,包括学生,老师,班级,课程,课程成绩,考试类别的操作。
3.2数据库表设计
以下为本系统中所有表的简单介绍:
1、管理员基本信息表包含管理员编号、管理员姓名、管理员密码,设计时注意sid设为主键,如表3.1所示:
表3.1 超级用户表
数据类型 | 长度 | 逻辑关系 | |
sid | int | 11 | 主键 |
username | varchar | 255 | |
password | varchar | 255 |
2、学生表包含的信息是学生编号、学生姓名、学生性别、学生年龄、家庭住址、联系电话等信息,设计时注意ID字段设为主键,如表3.2所示:
表3.2 学生表
字段名称 | 数据类型 | 长度 | 逻辑关系 |
sid | int | 11 | 主键 |
sno | varchar | 255 | |
sname | varchar | 255 | |
password | varchar | 255 | |
sgender | inr | 11 | |
class-id | inr | 11 | 外键 |
age | inr | 11 | |
address | varchar | 255 | |
mobile | varchar | 255 |
3、班级表包含的信息是班级编号、班级名,设计时注意ID字段设为主键,设为Int类型,如表3.3所示:
表3.3 班级表
字段名称 | 数据类型 | 长度 | 逻辑关系 |
cid | int | 11 | 主键 |
cname | varchar | 255 |
4、课程表包含的信息是课程编号、课程名、学时、学分,设计时注意ID字段设为主键,设为Int类型,如表3.4所示:
表3.4 课程表
字段名称 | 数据类型 | 长度 | 逻辑关系 |
cid | int | 11 | 主键 |
cname | varchar | 255 | |
cperiod- expriment | int | 255 | |
credit | int | 255 | |
ctype | varchar | 255 |
5、学生课程表包含的信息是学生编号、课程编号,如表3.5所示:
表3.5 学生课程表
字段名称 | 数据类型 | 长度 | 逻辑关系 |
id | int | 11 | 主键 |
sid | int | 11 | 外键 |
cid | int | 11 | 外键 |
6、分数表包含的信息是学生ID、课程ID,其中sid为主键,设为int型,如图3.6所示:
表3.6 分数表
字段名称 | 数据类型 | 长度 | 逻辑关系 |
sid | int | 11 | 主键 |
student-id | int | 11 | 外键 |
course-id | int | 11 | 外键 |
grade | int | 11 |
4.系统实现
4.1管理员
4.1.1登录功能模块
管理员登录页面如图4.1所示
图4.1 登录界面
管理员查看成绩功能如图4.2
图4.2 管理员-查看成绩
管理员添加新班级页面如图4.3
图4.3 管理员-添加新班级
管理员添加新成绩如图4.4
图4.4 管理员-添加新成绩
管理员添加新课程如图4.5
图4.5 管理员-添加新课程
管理员添加新学生如图4.6
图4.6 管理员-添加新学生
主要功能代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="ui.SuperuserHomeWin">
<grid id="27dc6" binding="superuserHomePanel" layout-manager="GridLayoutManager" row-count="2" column-count="7" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="770" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="d71e3" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="当前管理员"/>
</properties>
</component>
<component id="2941e" class="javax.swing.JLabel" binding="nameLabel">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="未知"/>
</properties>
</component>
<hspacer id="8dec2">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<tabbedpane id="b2724" binding="mainPanel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="7" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="ed54e" layout-manager="GridLayoutManager" row-count="2" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="添加新课程"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<hspacer id="1335a">
<constraints>
<grid row="0" column="0" row-span="1" col-span="3" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<scrollpane id="82a73">
<constraints>
<grid row="1" column="0" row-span="1" col-span="4" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none" title="课程详细信息(*号为必填内容)"/>
<children>
<component id="627fb" class="javax.swing.JTable" binding="newCourseTable">
<constraints/>
<properties>
<background color="-2034196"/>
<foreground color="-12502992"/>
</properties>
</component>
</children>
</scrollpane>
<component id="b41cc" class="javax.swing.JButton" binding="saveCourseButton">
<constraints>
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="保存"/>
</properties>
</component>
</children>
</grid>
<grid id="9bb49" layout-manager="GridLayoutManager" row-count="3" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="添加新学生"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="3ff86">
<constraints>
<grid row="1" column="0" row-span="1" col-span="4" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Apple Chancery" size="14" style="1"/>
<foreground color="-12502992"/>
</properties>
<border type="none" title="学生详细信息(*号为必填内容)"/>
<children>
<component id="f26ca" class="javax.swing.JTable" binding="studentDetailProfileTable">
<constraints/>
<properties>
<background color="-2034196"/>
</properties>
</component>
</children>
</scrollpane>
<hspacer id="b47fd">
<constraints>
<grid row="0" column="0" row-span="1" col-span="3" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<component id="6f39a" class="javax.swing.JButton" binding="saveStudentTableButton">
<constraints>
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="保存"/>
</properties>
</component>
<scrollpane id="ccad3">
<constraints>
<grid row="2" column="0" row-span="1" col-span="4" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Apple Chancery" size="14" style="1"/>
<foreground color="-12502992"/>
</properties>
<border type="none" title="选择学生所属班级"/>
<children>
<component id="1dc24" class="javax.swing.JComboBox" binding="classComboBox">
<constraints/>
<properties>
<model/>
</properties>
</component>
</children>
</scrollpane>
</children>
</grid>
<grid id="95c9d" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="添加新班级"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="42f74" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="50836">
<constraints>
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none" title="成绩详细信息(*号为必填内容)"/>
<children>
<component id="4ba56" class="javax.swing.JTable" binding="newClassTable">
<constraints/>
<properties>
<background color="-2034196"/>
<foreground color="-12502992"/>
</properties>
</component>
</children>
</scrollpane>
<component id="eb039" class="javax.swing.JButton" binding="classSaveBtn">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="保存"/>
</properties>
</component>
<hspacer id="1d289">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
</children>
</grid>
<grid id="5487e" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="课程成绩"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<splitpane id="b2350">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="244e5" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="left"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="86e05">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false">
<minimum-size width="250" height="-1"/>
</grid>
</constraints>
<properties/>
<border type="none" title="所有课程"/>
<children>
<component id="63a60" class="javax.swing.JTable" binding="courseListTable">
<constraints/>
<properties>
<background color="-2034196"/>
<enabled value="false"/>
<foreground color="-12502992"/>
</properties>
</component>
</children>
</scrollpane>
</children>
</grid>
<grid id="8d877" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="4629c" binding="courseScorePanel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none" title="该课程学生成绩"/>
<children>
<component id="3fd61" class="javax.swing.JTable" binding="courseScoreTable">
<constraints/>
<properties>
<background color="-2034196"/>
<enabled value="false"/>
<foreground color="-12502992"/>
</properties>
</component>
</children>
</scrollpane>
</children>
</grid>
</children>
</splitpane>
</children>
</grid>
<grid id="58b33" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="添加新成绩"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="2d0df" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="f44a9">
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none" title="成绩详细信息"/>
<children>
<component id="d4b93" class="javax.swing.JTable" binding="addScoreTable">
<constraints/>
<properties>
<background color="-2034196"/>
<foreground color="-12502992"/>
</properties>
</component>
</children>
</scrollpane>
<scrollpane id="6f7a7">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Apple Chancery" size="14" style="1"/>
<foreground color="-12502992"/>
</properties>
<border type="none" title="课程选择"/>
<children>
<component id="58c67" class="javax.swing.JComboBox" binding="courseComboBox">
<constraints/>
<properties>
<model/>
</properties>
</component>
</children>
</scrollpane>
<scrollpane id="69da9">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Apple Chancery" size="14" style="1"/>
<foreground color="-12502992"/>
</properties>
<border type="none" title="学生选择"/>
<children>
<component id="cbc87" class="javax.swing.JComboBox" binding="stuComboBox">
<constraints/>
<properties>
<model/>
</properties>
</component>
</children>
</scrollpane>
</children>
</grid>
<component id="728c5" class="javax.swing.JButton" binding="saveScoreBtn">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="保存成绩信息"/>
</properties>
</component>
</children>
</grid>
</children>
</tabbedpane>
<component id="30b08" class="javax.swing.JButton" binding="exitButton">
<constraints>
<grid row="0" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="退出"/>
</properties>
</component>
<component id="84274" class="javax.swing.JButton" binding="refreshBtn">
<constraints>
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="刷新"/>
</properties>
</component>
</children>
</grid>
</form>
4.1.2登录功能模块
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="ui.LoginWin">
<grid id="27dc6" binding="LoginPanel" layout-manager="GridLayoutManager" row-count="6" column-count="7" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="472d1" class="javax.swing.JTextField" binding="usernameTextField">
<constraints>
<grid row="2" column="2" row-span="1" col-span="4" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
<component id="dc459" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="用户名"/>
</properties>
</component>
<hspacer id="77f66">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<hspacer id="2ded4">
<constraints>
<grid row="2" column="6" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<component id="5f2dd" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="密码"/>
</properties>
</component>
<vspacer id="65983">
<constraints>
<grid row="0" column="2" row-span="1" col-span="3" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="6bbef">
<constraints>
<grid row="5" column="2" row-span="1" col-span="3" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="e13f6" class="javax.swing.JPasswordField" binding="passwordTextField">
<constraints>
<grid row="3" column="2" row-span="1" col-span="4" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
<component id="4e649" class="javax.swing.JLabel" binding="titleLabel">
<constraints>
<grid row="1" column="1" row-span="1" col-span="5" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="YouYuan" size="28" style="0"/>
<foreground color="-7166023"/>
<text value="学生管理系统"/>
</properties>
</component>
<component id="1925b" class="javax.swing.JButton" binding="loginButton">
<constraints>
<grid row="4" column="2" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="登录"/>
</properties>
</component>
<component id="5b807" class="javax.swing.JButton" binding="resetBtn">
<constraints>
<grid row="4" column="5" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="重置"/>
</properties>
</component>
</children>
</grid>
<buttonGroups>
<group name="usertype">
<member id="99dfa"/>
<member id="94f54"/>
<member id="755f5"/>
</group>
</buttonGroups>
</form>
4.2普通用户
4.2.1登录功能模块
普通用户登录页面如图4.1所示。
图4.1 登录界面
普通用户的成绩页面如图4.2所示
图4.2 学生-我的成绩
普通用户的个人资料页面如图4.3所示
图4.3 学生-我的个人资料
普通用户的课程页面如图4.4所示
图4.4 学生-我的课程
主要功能代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="ui.StuHomeWin">
<grid id="27dc6" binding="stuHomePanel" layout-manager="GridLayoutManager" row-count="2" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="534e7" class="javax.swing.JButton" binding="exitButton">
<constraints>
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="注销"/>
</properties>
</component>
<component id="76c45" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="当前登录学生:"/>
</properties>
</component>
<component id="29155" class="javax.swing.JLabel" binding="nameLabel">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="未知"/>
</properties>
</component>
<hspacer id="e3542">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<grid id="d846c" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="55668" binding="tabbedPane1" default-binding="true">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="f70b0" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<tabbedpane title="我的成绩"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="a2a3a">
<constraints border-constraint="Center"/>
<properties/>
<border type="none" title="成绩列表"/>
<children>
<component id="24acc" class="javax.swing.JTable" binding="scoreTable">
<constraints/>
<properties>
<background color="-2034196"/>
<enabled value="false"/>
<foreground color="-12502992"/>
</properties>
</component>
</children>
</scrollpane>
</children>
</grid>
<grid id="e79c8" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="我的课程"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="69df2" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="59950">
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none" title="课程列表"/>
<children>
<component id="53770" class="javax.swing.JTable" binding="courseTable">
<constraints/>
<properties>
<autoResizeMode value="2"/>
<background color="-2034196"/>
<enabled value="false"/>
<foreground color="-12502992"/>
</properties>
</component>
</children>
</scrollpane>
<hspacer id="c051e">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
</children>
</grid>
<grid id="c6675" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="个人资料"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="e1475" class="javax.swing.JButton" binding="modifyButton">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="修改"/>
</properties>
</component>
<grid id="93581" layout-manager="GridLayoutManager" row-count="8" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="fdc1a" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="学号"/>
</properties>
</component>
<component id="81f85" class="javax.swing.JTextField" binding="studentCode">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="cbeb6" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="姓名"/>
</properties>
</component>
<component id="7b1d2" class="javax.swing.JTextField" binding="nameField">
<constraints>
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="80bf8" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="年龄"/>
</properties>
</component>
<component id="f3f41" class="javax.swing.JTextField" binding="ageField">
<constraints>
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="2c7f4" class="javax.swing.JTextField" binding="genderField">
<constraints>
<grid row="4" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="fa5b" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="性别"/>
</properties>
</component>
<component id="de51b" class="javax.swing.JLabel">
<constraints>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="地址"/>
</properties>
</component>
<component id="f8700" class="javax.swing.JTextField" binding="addressField">
<constraints>
<grid row="5" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
<component id="3c95d" class="javax.swing.JLabel">
<constraints>
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="电话"/>
</properties>
</component>
<component id="f7cc2" class="javax.swing.JTextField" binding="mobileField">
<constraints>
<grid row="6" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
<component id="6c74e" class="javax.swing.JLabel">
<constraints>
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="email"/>
</properties>
</component>
<component id="2616b" class="javax.swing.JTextField" binding="emailField">
<constraints>
<grid row="7" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
<component id="6fe91" class="javax.swing.JTextField" binding="studentClassField">
<constraints>
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
</properties>
</component>
<component id="3bf84" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="班级"/>
</properties>
</component>
<hspacer id="1a595">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<hspacer id="b8bf3">
<constraints>
<grid row="3" column="3" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
</children>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</children>
</grid>
</form>
4.2.2登录功能模块
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="ui.LoginWin">
<grid id="27dc6" binding="LoginPanel" layout-manager="GridLayoutManager" row-count="6" column-count="7" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="472d1" class="javax.swing.JTextField" binding="usernameTextField">
<constraints>
<grid row="2" column="2" row-span="1" col-span="4" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
<component id="dc459" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="用户名"/>
</properties>
</component>
<hspacer id="77f66">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<hspacer id="2ded4">
<constraints>
<grid row="2" column="6" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<component id="5f2dd" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="密码"/>
</properties>
</component>
<vspacer id="65983">
<constraints>
<grid row="0" column="2" row-span="1" col-span="3" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="6bbef">
<constraints>
<grid row="5" column="2" row-span="1" col-span="3" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="e13f6" class="javax.swing.JPasswordField" binding="passwordTextField">
<constraints>
<grid row="3" column="2" row-span="1" col-span="4" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
<component id="4e649" class="javax.swing.JLabel" binding="titleLabel">
<constraints>
<grid row="1" column="1" row-span="1" col-span="5" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="YouYuan" size="28" style="0"/>
<foreground color="-7166023"/>
<text value="学生管理系统"/>
</properties>
</component>
<component id="1925b" class="javax.swing.JButton" binding="loginButton">
<constraints>
<grid row="4" column="2" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="登录"/>
</properties>
</component>
<component id="5b807" class="javax.swing.JButton" binding="resetBtn">
<constraints>
<grid row="4" column="5" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="重置"/>
</properties>
</component>
</children>
</grid>
<buttonGroups>
<group name="usertype">
<member id="99dfa"/>
<member id="94f54"/>
<member id="755f5"/>
</group>
</buttonGroups>
</form>
5.系统测试
测试用例名 | 测试步骤 | 预期结果 | 实测结果 |
"DBConnection连接" 测试 | 实例化DBConnection对象,调用Connect()方法 | 控制台没有打印异常 | 与预期结果相符 |
"DBConnection关闭连接" 测试 | 实例化DBConnection对象,调用close()方法 | 程序执行过程中没有任何异常,程序正常退出 | 与预期结果相符 |
"DBConnection查询" 测试 | 实例化DBConnection对象,调用Connect()方法,调用getQuery(String sql)方法传入sql语句,调用close()方法 | 返回查询结果 | 与预期结果相符 |
"DBConnection批量查询" 测试 | 实例化DBConnection对象,调用Connect()方法,调用getQueryMany(String sql1, String sql2) 方法传入两条sql语句,调用close()方法 | 返回查询结果 | 与预期结果相符 |
"DBConnection插入删除更新" 测试 | 实例化"DBConnection对象,调用Connect()方法,调用update(String sql)方法传入sql语句,调用close()方法 | 返回查询修改结果数量 | 与预期结果相符 |
"DBHelper查看学生列表" 测试 | 调用getStudentList()方法 | 返回学生列表 | 与预期结果相符 |
"DBHelper登录" 测试 | 调用stuLogin(String username, String pwd)方法,传入用户名和密码 | 返回非-1 | 与预期结果相符 |
"DBHelper超级用户登录" 测试 | 调用superUserLogin(String username, String pwd)方法,传入超级管理员用户名和密码 | 返回非-1 | 与预期结果相符 |
"DBHelper添加学生信息" 测试 | 调用addStuProfile()方法,传入学生信息 | 返回true | 与预期结果相符 |
"DBHelper通过主键查看学生成绩" 测试 | 调用selectStuScoreBySID(int sid) 方法 | 返回学生成绩 | 与预期结果相符 |
"DBHelper添加学生成绩" 测试 | 调用addScoreProfile(int stuID, int courseID, int grade)方法 | 返回true | 与预期结果相符 |
"DBHelper查看科目成绩" 测试 | 调用selectStuScoreByCID(int courseID)方法 | 返回科目成绩 | 与预期结果相符 |
"DBHelper查看学生某一科目成绩" 测试 | 调用selectStuScorebySIDandCID(int sid, int cid)方法 | 返回科目成绩 | 与预期结果相符 |
"DBHelper修改学生密码" 测试 | 调用updateStuPWD(String newPWD, int id)方法 | 返回true | 与预期结果相符 |
"DBHelper查看学生基本信息" 测试 | 调用selectStuProfile(int id)方法 | 返回学生信息 | 与预期结果相符 |
"DBHelper查看管理员信息" 测试 | 调用selectSuperuserProfile(int id)方法 | 返回管理员信息 | 与预期结果相符 |
"DBHelper通过学生主键查看学生选课" 测试 | 调用selectCourseList(int studentID)方法 | 返回学生选课 | 与预期结果相符 |
"DBHelper修改学生班级" 测试 | 调用updateStuClassBySID(int studentID, int newClassID)方法 | 返回true | 与预期结果相符 |
"DBHelper修改学生信息" 测试 | 调用updateStuProfile()方法 | 返回true | 与预期结果相符 |
"DBHelper通过课程主键查询成绩排名" 测试 | 调用getScoreRankingByCID(int courseID)方法 | 返回成绩排名 | 与预期结果相符 |
"DBHelper查看课程列表" 测试 | 调用getCourseList()方法 | 返回课程列表 | 与预期结果相符 |
"DBHelper通过课程名称查询课程" 测试 | 调用selectCourseByCName()方法 | 返回查看课程 | 与预期结果相符 |
"DBHelper添加课程" 测试 | 调用addCourse()方法 | 返回true | 与预期结果相符 |
"DBHelper通过课程主键修改课程信息" 测试 | 调用updateCourseInfo()方法 | 返回true | 与预期结果相符 |
"DBHelper查看班级列表" 测试 | 调用selectClassList()方法 | 返回班级列表 | 与预期结果相符 |
"DBHelper添加班级" 测试 | 调用addClass(String newClassName)方法 | 返回true | 与预期结果相符 |
"DBHelper修改班级名称" 测试 | 调用renameClassByCID(int classID, String newClassName)方法 | 返回true | 与预期结果相符 |
结 论
充实的Java课程设计结束了,从刚开始的不只如何下手到最后看到自己的程序按自己的想法运行,心里时不时的有一种喜悦。通过这两周的实验,我认识到书上和老师教的内容是有限的,要想掌握更多的知识我们必须多动脑,多思考,不断地靠自己去学习,同时我们还应向他人请教,从而了解更多自己不知道的知识。
通过这两周的编程我发现了自己的一些不足,在编写时经常犯一些低级错误,由于我们的马虎而浪费了不少时间。这些不足既然被发现就得在以后的做事中注意,争取改掉。
在这期间,经过努力我们掌握了一些基本的面向对象语言进行程序设计的技巧,更深的理解和运用结构化程序设计的思想和方法,掌握开发一个小型实用系统的基本方法,同时学会了一些调试一个较长程序的基本方法,提高了书写程序设计开发文档的能力(书写课程设计报告)。
这次的课程设计让我们受益匪浅,在此我们要感谢孜孜不倦指导我们的老师,感谢在困惑时给我们帮助的同学,感谢学校给我们一个这样动手动脑的机会,使我们在理论与实践相结合方面又得到了一次很好的锻炼,让我们得到很大的收获。
总之,我们会继续编写程序的,相信在越来越多的尝试之后,会不断进步不断提高的。