当前位置:   article > 正文

Java课程设计——学生管理系统的设计与实现

java课程设计

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 管理员-添加新学生

主要功能代码如下:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="ui.SuperuserHomeWin">
  3.   <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">
  4.     <margin top="0" left="0" bottom="0" right="0"/>
  5.     <constraints>
  6.       <xy x="20" y="20" width="770" height="400"/>
  7.     </constraints>
  8.     <properties/>
  9.     <border type="none"/>
  10.     <children>
  11.       <component id="d71e3" class="javax.swing.JLabel">
  12.         <constraints>
  13.           <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"/>
  14.         </constraints>
  15.         <properties>
  16.           <text value="当前管理员"/>
  17.         </properties>
  18.       </component>
  19.       <component id="2941e" class="javax.swing.JLabel" binding="nameLabel">
  20.         <constraints>
  21.           <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"/>
  22.         </constraints>
  23.         <properties>
  24.           <text value="未知"/>
  25.         </properties>
  26.       </component>
  27.       <hspacer id="8dec2">
  28.         <constraints>
  29.           <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"/>
  30.         </constraints>
  31.       </hspacer>
  32.       <tabbedpane id="b2724" binding="mainPanel">
  33.         <constraints>
  34.           <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">
  35.             <preferred-size width="200" height="200"/>
  36.           </grid>
  37.         </constraints>
  38.         <properties/>
  39.         <border type="none"/>
  40.         <children>
  41.           <grid id="ed54e" layout-manager="GridLayoutManager" row-count="2" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  42.             <margin top="0" left="0" bottom="0" right="0"/>
  43.             <constraints>
  44.               <tabbedpane title="添加新课程"/>
  45.             </constraints>
  46.             <properties/>
  47.             <border type="none"/>
  48.             <children>
  49.               <hspacer id="1335a">
  50.                 <constraints>
  51.                   <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"/>
  52.                 </constraints>
  53.               </hspacer>
  54.               <scrollpane id="82a73">
  55.                 <constraints>
  56.                   <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"/>
  57.                 </constraints>
  58.                 <properties/>
  59.                 <border type="none" title="课程详细信息(*号为必填内容)"/>
  60.                 <children>
  61.                   <component id="627fb" class="javax.swing.JTable" binding="newCourseTable">
  62.                     <constraints/>
  63.                     <properties>
  64.                       <background color="-2034196"/>
  65.                       <foreground color="-12502992"/>
  66.                     </properties>
  67.                   </component>
  68.                 </children>
  69.               </scrollpane>
  70.               <component id="b41cc" class="javax.swing.JButton" binding="saveCourseButton">
  71.                 <constraints>
  72.                   <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"/>
  73.                 </constraints>
  74.                 <properties>
  75.                   <text value="保存"/>
  76.                 </properties>
  77.               </component>
  78.             </children>
  79.           </grid>
  80.           <grid id="9bb49" layout-manager="GridLayoutManager" row-count="3" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  81.             <margin top="0" left="0" bottom="0" right="0"/>
  82.             <constraints>
  83.               <tabbedpane title="添加新学生"/>
  84.             </constraints>
  85.             <properties/>
  86.             <border type="none"/>
  87.             <children>
  88.               <scrollpane id="3ff86">
  89.                 <constraints>
  90.                   <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"/>
  91.                 </constraints>
  92.                 <properties>
  93.                   <font name="Apple Chancery" size="14" style="1"/>
  94.                   <foreground color="-12502992"/>
  95.                 </properties>
  96.                 <border type="none" title="学生详细信息(*号为必填内容)"/>
  97.                 <children>
  98.                   <component id="f26ca" class="javax.swing.JTable" binding="studentDetailProfileTable">
  99.                     <constraints/>
  100.                     <properties>
  101.                       <background color="-2034196"/>
  102.                     </properties>
  103.                   </component>
  104.                 </children>
  105.               </scrollpane>
  106.               <hspacer id="b47fd">
  107.                 <constraints>
  108.                   <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"/>
  109.                 </constraints>
  110.               </hspacer>
  111.               <component id="6f39a" class="javax.swing.JButton" binding="saveStudentTableButton">
  112.                 <constraints>
  113.                   <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"/>
  114.                 </constraints>
  115.                 <properties>
  116.                   <text value="保存"/>
  117.                 </properties>
  118.               </component>
  119.               <scrollpane id="ccad3">
  120.                 <constraints>
  121.                   <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"/>
  122.                 </constraints>
  123.                 <properties>
  124.                   <font name="Apple Chancery" size="14" style="1"/>
  125.                   <foreground color="-12502992"/>
  126.                 </properties>
  127.                 <border type="none" title="选择学生所属班级"/>
  128.                 <children>
  129.                   <component id="1dc24" class="javax.swing.JComboBox" binding="classComboBox">
  130.                     <constraints/>
  131.                     <properties>
  132.                       <model/>
  133.                     </properties>
  134.                   </component>
  135.                 </children>
  136.               </scrollpane>
  137.             </children>
  138.           </grid>
  139.           <grid id="95c9d" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  140.             <margin top="0" left="0" bottom="0" right="0"/>
  141.             <constraints>
  142.               <tabbedpane title="添加新班级"/>
  143.             </constraints>
  144.             <properties/>
  145.             <border type="none"/>
  146.             <children>
  147.               <grid id="42f74" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  148.                 <margin top="0" left="0" bottom="0" right="0"/>
  149.                 <constraints>
  150.                   <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"/>
  151.                 </constraints>
  152.                 <properties/>
  153.                 <border type="none"/>
  154.                 <children>
  155.                   <scrollpane id="50836">
  156.                     <constraints>
  157.                       <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"/>
  158.                     </constraints>
  159.                     <properties/>
  160.                     <border type="none" title="成绩详细信息(*号为必填内容)"/>
  161.                     <children>
  162.                       <component id="4ba56" class="javax.swing.JTable" binding="newClassTable">
  163.                         <constraints/>
  164.                         <properties>
  165.                           <background color="-2034196"/>
  166.                           <foreground color="-12502992"/>
  167.                         </properties>
  168.                       </component>
  169.                     </children>
  170.                   </scrollpane>
  171.                   <component id="eb039" class="javax.swing.JButton" binding="classSaveBtn">
  172.                     <constraints>
  173.                       <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"/>
  174.                     </constraints>
  175.                     <properties>
  176.                       <text value="保存"/>
  177.                     </properties>
  178.                   </component>
  179.                   <hspacer id="1d289">
  180.                     <constraints>
  181.                       <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"/>
  182.                     </constraints>
  183.                   </hspacer>
  184.                 </children>
  185.               </grid>
  186.             </children>
  187.           </grid>
  188.           <grid id="5487e" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  189.             <margin top="0" left="0" bottom="0" right="0"/>
  190.             <constraints>
  191.               <tabbedpane title="课程成绩"/>
  192.             </constraints>
  193.             <properties/>
  194.             <border type="none"/>
  195.             <children>
  196.               <splitpane id="b2350">
  197.                 <constraints>
  198.                   <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">
  199.                     <preferred-size width="200" height="200"/>
  200.                   </grid>
  201.                 </constraints>
  202.                 <properties/>
  203.                 <border type="none"/>
  204.                 <children>
  205.                   <grid id="244e5" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  206.                     <margin top="0" left="0" bottom="0" right="0"/>
  207.                     <constraints>
  208.                       <splitpane position="left"/>
  209.                     </constraints>
  210.                     <properties/>
  211.                     <border type="none"/>
  212.                     <children>
  213.                       <scrollpane id="86e05">
  214.                         <constraints>
  215.                           <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">
  216.                             <minimum-size width="250" height="-1"/>
  217.                           </grid>
  218.                         </constraints>
  219.                         <properties/>
  220.                         <border type="none" title="所有课程"/>
  221.                         <children>
  222.                           <component id="63a60" class="javax.swing.JTable" binding="courseListTable">
  223.                             <constraints/>
  224.                             <properties>
  225.                               <background color="-2034196"/>
  226.                               <enabled value="false"/>
  227.                               <foreground color="-12502992"/>
  228.                             </properties>
  229.                           </component>
  230.                         </children>
  231.                       </scrollpane>
  232.                     </children>
  233.                   </grid>
  234.                   <grid id="8d877" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  235.                     <margin top="0" left="0" bottom="0" right="0"/>
  236.                     <constraints>
  237.                       <splitpane position="right"/>
  238.                     </constraints>
  239.                     <properties/>
  240.                     <border type="none"/>
  241.                     <children>
  242.                       <scrollpane id="4629c" binding="courseScorePanel">
  243.                         <constraints>
  244.                           <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"/>
  245.                         </constraints>
  246.                         <properties/>
  247.                         <border type="none" title="该课程学生成绩"/>
  248.                         <children>
  249.                           <component id="3fd61" class="javax.swing.JTable" binding="courseScoreTable">
  250.                             <constraints/>
  251.                             <properties>
  252.                               <background color="-2034196"/>
  253.                               <enabled value="false"/>
  254.                               <foreground color="-12502992"/>
  255.                             </properties>
  256.                           </component>
  257.                         </children>
  258.                       </scrollpane>
  259.                     </children>
  260.                   </grid>
  261.                 </children>
  262.               </splitpane>
  263.             </children>
  264.           </grid>
  265.           <grid id="58b33" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  266.             <margin top="0" left="0" bottom="0" right="0"/>
  267.             <constraints>
  268.               <tabbedpane title="添加新成绩"/>
  269.             </constraints>
  270.             <properties/>
  271.             <border type="none"/>
  272.             <children>
  273.               <grid id="2d0df" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  274.                 <margin top="0" left="0" bottom="0" right="0"/>
  275.                 <constraints>
  276.                   <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"/>
  277.                 </constraints>
  278.                 <properties/>
  279.                 <border type="none"/>
  280.                 <children>
  281.                   <scrollpane id="f44a9">
  282.                     <constraints>
  283.                       <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"/>
  284.                     </constraints>
  285.                     <properties/>
  286.                     <border type="none" title="成绩详细信息"/>
  287.                     <children>
  288.                       <component id="d4b93" class="javax.swing.JTable" binding="addScoreTable">
  289.                         <constraints/>
  290.                         <properties>
  291.                           <background color="-2034196"/>
  292.                           <foreground color="-12502992"/>
  293.                         </properties>
  294.                       </component>
  295.                     </children>
  296.                   </scrollpane>
  297.                   <scrollpane id="6f7a7">
  298.                     <constraints>
  299.                       <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"/>
  300.                     </constraints>
  301.                     <properties>
  302.                       <font name="Apple Chancery" size="14" style="1"/>
  303.                       <foreground color="-12502992"/>
  304.                     </properties>
  305.                     <border type="none" title="课程选择"/>
  306.                     <children>
  307.                       <component id="58c67" class="javax.swing.JComboBox" binding="courseComboBox">
  308.                         <constraints/>
  309.                         <properties>
  310.                           <model/>
  311.                         </properties>
  312.                       </component>
  313.                     </children>
  314.                   </scrollpane>
  315.                   <scrollpane id="69da9">
  316.                     <constraints>
  317.                       <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"/>
  318.                     </constraints>
  319.                     <properties>
  320.                       <font name="Apple Chancery" size="14" style="1"/>
  321.                       <foreground color="-12502992"/>
  322.                     </properties>
  323.                     <border type="none" title="学生选择"/>
  324.                     <children>
  325.                       <component id="cbc87" class="javax.swing.JComboBox" binding="stuComboBox">
  326.                         <constraints/>
  327.                         <properties>
  328.                           <model/>
  329.                         </properties>
  330.                       </component>
  331.                     </children>
  332.                   </scrollpane>
  333.                 </children>
  334.               </grid>
  335.               <component id="728c5" class="javax.swing.JButton" binding="saveScoreBtn">
  336.                 <constraints>
  337.                   <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"/>
  338.                 </constraints>
  339.                 <properties>
  340.                   <text value="保存成绩信息"/>
  341.                 </properties>
  342.               </component>
  343.             </children>
  344.           </grid>
  345.         </children>
  346.       </tabbedpane>
  347.       <component id="30b08" class="javax.swing.JButton" binding="exitButton">
  348.         <constraints>
  349.           <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"/>
  350.         </constraints>
  351.         <properties>
  352.           <text value="退出"/>
  353.         </properties>
  354.       </component>
  355.       <component id="84274" class="javax.swing.JButton" binding="refreshBtn">
  356.         <constraints>
  357.           <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"/>
  358.         </constraints>
  359.         <properties>
  360.           <text value="刷新"/>
  361.         </properties>
  362.       </component>
  363.     </children>
  364.   </grid>
  365. </form>

4.1.2登录功能模块

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="ui.LoginWin">
  3.   <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">
  4.     <margin top="0" left="0" bottom="0" right="0"/>
  5.     <constraints>
  6.       <xy x="20" y="20" width="500" height="400"/>
  7.     </constraints>
  8.     <properties/>
  9.     <border type="none"/>
  10.     <children>
  11.       <component id="472d1" class="javax.swing.JTextField" binding="usernameTextField">
  12.         <constraints>
  13.           <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">
  14.             <preferred-size width="150" height="-1"/>
  15.           </grid>
  16.         </constraints>
  17.         <properties>
  18.           <text value=""/>
  19.         </properties>
  20.       </component>
  21.       <component id="dc459" class="javax.swing.JLabel">
  22.         <constraints>
  23.           <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"/>
  24.         </constraints>
  25.         <properties>
  26.           <text value="用户名"/>
  27.         </properties>
  28.       </component>
  29.       <hspacer id="77f66">
  30.         <constraints>
  31.           <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"/>
  32.         </constraints>
  33.       </hspacer>
  34.       <hspacer id="2ded4">
  35.         <constraints>
  36.           <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"/>
  37.         </constraints>
  38.       </hspacer>
  39.       <component id="5f2dd" class="javax.swing.JLabel">
  40.         <constraints>
  41.           <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"/>
  42.         </constraints>
  43.         <properties>
  44.           <text value="密码"/>
  45.         </properties>
  46.       </component>
  47.       <vspacer id="65983">
  48.         <constraints>
  49.           <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"/>
  50.         </constraints>
  51.       </vspacer>
  52.       <vspacer id="6bbef">
  53.         <constraints>
  54.           <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"/>
  55.         </constraints>
  56.       </vspacer>
  57.       <component id="e13f6" class="javax.swing.JPasswordField" binding="passwordTextField">
  58.         <constraints>
  59.           <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">
  60.             <preferred-size width="150" height="-1"/>
  61.           </grid>
  62.         </constraints>
  63.         <properties>
  64.           <text value=""/>
  65.         </properties>
  66.       </component>
  67.       <component id="4e649" class="javax.swing.JLabel" binding="titleLabel">
  68.         <constraints>
  69.           <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"/>
  70.         </constraints>
  71.         <properties>
  72.           <font name="YouYuan" size="28" style="0"/>
  73.           <foreground color="-7166023"/>
  74.           <text value="学生管理系统"/>
  75.         </properties>
  76.       </component>
  77.       <component id="1925b" class="javax.swing.JButton" binding="loginButton">
  78.         <constraints>
  79.           <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"/>
  80.         </constraints>
  81.         <properties>
  82.           <text value="登录"/>
  83.         </properties>
  84.       </component>
  85.       <component id="5b807" class="javax.swing.JButton" binding="resetBtn">
  86.         <constraints>
  87.           <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"/>
  88.         </constraints>
  89.         <properties>
  90.           <text value="重置"/>
  91.         </properties>
  92.       </component>
  93.     </children>
  94.   </grid>
  95.   <buttonGroups>
  96.     <group name="usertype">
  97.       <member id="99dfa"/>
  98.       <member id="94f54"/>
  99.       <member id="755f5"/>
  100.     </group>
  101.   </buttonGroups>
  102. </form>

4.2普通用户

4.2.1登录功能模块

普通用户登录页面如图4.1所示。

图4.1 登录界面

普通用户的成绩页面如图4.2所示

图4.2 学生-我的成绩

普通用户的个人资料页面如图4.3所示

图4.3 学生-我的个人资料

普通用户的课程页面如图4.4所示

图4.4 学生-我的课程

主要功能代码如下:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="ui.StuHomeWin">
  3. <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">
  4. <margin top="0" left="0" bottom="0" right="0"/>
  5. <constraints>
  6. <xy x="20" y="20" width="500" height="400"/>
  7. </constraints>
  8. <properties/>
  9. <border type="none"/>
  10. <children>
  11. <component id="534e7" class="javax.swing.JButton" binding="exitButton">
  12. <constraints>
  13. <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"/>
  14. </constraints>
  15. <properties>
  16. <text value="注销"/>
  17. </properties>
  18. </component>
  19. <component id="76c45" class="javax.swing.JLabel">
  20. <constraints>
  21. <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"/>
  22. </constraints>
  23. <properties>
  24. <text value="当前登录学生:"/>
  25. </properties>
  26. </component>
  27. <component id="29155" class="javax.swing.JLabel" binding="nameLabel">
  28. <constraints>
  29. <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"/>
  30. </constraints>
  31. <properties>
  32. <text value="未知"/>
  33. </properties>
  34. </component>
  35. <hspacer id="e3542">
  36. <constraints>
  37. <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"/>
  38. </constraints>
  39. </hspacer>
  40. <grid id="d846c" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  41. <margin top="0" left="0" bottom="0" right="0"/>
  42. <constraints>
  43. <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"/>
  44. </constraints>
  45. <properties/>
  46. <border type="none"/>
  47. <children>
  48. <tabbedpane id="55668" binding="tabbedPane1" default-binding="true">
  49. <constraints>
  50. <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">
  51. <preferred-size width="200" height="200"/>
  52. </grid>
  53. </constraints>
  54. <properties/>
  55. <border type="none"/>
  56. <children>
  57. <grid id="f70b0" layout-manager="BorderLayout" hgap="0" vgap="0">
  58. <constraints>
  59. <tabbedpane title="我的成绩"/>
  60. </constraints>
  61. <properties/>
  62. <border type="none"/>
  63. <children>
  64. <scrollpane id="a2a3a">
  65. <constraints border-constraint="Center"/>
  66. <properties/>
  67. <border type="none" title="成绩列表"/>
  68. <children>
  69. <component id="24acc" class="javax.swing.JTable" binding="scoreTable">
  70. <constraints/>
  71. <properties>
  72. <background color="-2034196"/>
  73. <enabled value="false"/>
  74. <foreground color="-12502992"/>
  75. </properties>
  76. </component>
  77. </children>
  78. </scrollpane>
  79. </children>
  80. </grid>
  81. <grid id="e79c8" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  82. <margin top="0" left="0" bottom="0" right="0"/>
  83. <constraints>
  84. <tabbedpane title="我的课程"/>
  85. </constraints>
  86. <properties/>
  87. <border type="none"/>
  88. <children>
  89. <grid id="69df2" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  90. <margin top="0" left="0" bottom="0" right="0"/>
  91. <constraints>
  92. <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"/>
  93. </constraints>
  94. <properties/>
  95. <border type="none"/>
  96. <children>
  97. <scrollpane id="59950">
  98. <constraints>
  99. <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"/>
  100. </constraints>
  101. <properties/>
  102. <border type="none" title="课程列表"/>
  103. <children>
  104. <component id="53770" class="javax.swing.JTable" binding="courseTable">
  105. <constraints/>
  106. <properties>
  107. <autoResizeMode value="2"/>
  108. <background color="-2034196"/>
  109. <enabled value="false"/>
  110. <foreground color="-12502992"/>
  111. </properties>
  112. </component>
  113. </children>
  114. </scrollpane>
  115. <hspacer id="c051e">
  116. <constraints>
  117. <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"/>
  118. </constraints>
  119. </hspacer>
  120. </children>
  121. </grid>
  122. </children>
  123. </grid>
  124. <grid id="c6675" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  125. <margin top="0" left="0" bottom="0" right="0"/>
  126. <constraints>
  127. <tabbedpane title="个人资料"/>
  128. </constraints>
  129. <properties/>
  130. <border type="none"/>
  131. <children>
  132. <component id="e1475" class="javax.swing.JButton" binding="modifyButton">
  133. <constraints>
  134. <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"/>
  135. </constraints>
  136. <properties>
  137. <text value="修改"/>
  138. </properties>
  139. </component>
  140. <grid id="93581" layout-manager="GridLayoutManager" row-count="8" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
  141. <margin top="0" left="0" bottom="0" right="0"/>
  142. <constraints>
  143. <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"/>
  144. </constraints>
  145. <properties/>
  146. <border type="none"/>
  147. <children>
  148. <component id="fdc1a" class="javax.swing.JLabel">
  149. <constraints>
  150. <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"/>
  151. </constraints>
  152. <properties>
  153. <text value="学号"/>
  154. </properties>
  155. </component>
  156. <component id="81f85" class="javax.swing.JTextField" binding="studentCode">
  157. <constraints>
  158. <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">
  159. <preferred-size width="150" height="-1"/>
  160. </grid>
  161. </constraints>
  162. <properties>
  163. <editable value="false"/>
  164. </properties>
  165. </component>
  166. <component id="cbeb6" class="javax.swing.JLabel">
  167. <constraints>
  168. <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"/>
  169. </constraints>
  170. <properties>
  171. <text value="姓名"/>
  172. </properties>
  173. </component>
  174. <component id="7b1d2" class="javax.swing.JTextField" binding="nameField">
  175. <constraints>
  176. <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">
  177. <preferred-size width="150" height="-1"/>
  178. </grid>
  179. </constraints>
  180. <properties>
  181. <editable value="false"/>
  182. </properties>
  183. </component>
  184. <component id="80bf8" class="javax.swing.JLabel">
  185. <constraints>
  186. <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"/>
  187. </constraints>
  188. <properties>
  189. <text value="年龄"/>
  190. </properties>
  191. </component>
  192. <component id="f3f41" class="javax.swing.JTextField" binding="ageField">
  193. <constraints>
  194. <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">
  195. <preferred-size width="150" height="-1"/>
  196. </grid>
  197. </constraints>
  198. <properties/>
  199. </component>
  200. <component id="2c7f4" class="javax.swing.JTextField" binding="genderField">
  201. <constraints>
  202. <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">
  203. <preferred-size width="150" height="-1"/>
  204. </grid>
  205. </constraints>
  206. <properties>
  207. <editable value="false"/>
  208. </properties>
  209. </component>
  210. <component id="fa5b" class="javax.swing.JLabel">
  211. <constraints>
  212. <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"/>
  213. </constraints>
  214. <properties>
  215. <text value="性别"/>
  216. </properties>
  217. </component>
  218. <component id="de51b" class="javax.swing.JLabel">
  219. <constraints>
  220. <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"/>
  221. </constraints>
  222. <properties>
  223. <text value="地址"/>
  224. </properties>
  225. </component>
  226. <component id="f8700" class="javax.swing.JTextField" binding="addressField">
  227. <constraints>
  228. <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">
  229. <preferred-size width="150" height="-1"/>
  230. </grid>
  231. </constraints>
  232. <properties>
  233. <text value=""/>
  234. </properties>
  235. </component>
  236. <component id="3c95d" class="javax.swing.JLabel">
  237. <constraints>
  238. <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"/>
  239. </constraints>
  240. <properties>
  241. <text value="电话"/>
  242. </properties>
  243. </component>
  244. <component id="f7cc2" class="javax.swing.JTextField" binding="mobileField">
  245. <constraints>
  246. <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">
  247. <preferred-size width="150" height="-1"/>
  248. </grid>
  249. </constraints>
  250. <properties>
  251. <text value=""/>
  252. </properties>
  253. </component>
  254. <component id="6c74e" class="javax.swing.JLabel">
  255. <constraints>
  256. <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"/>
  257. </constraints>
  258. <properties>
  259. <text value="email"/>
  260. </properties>
  261. </component>
  262. <component id="2616b" class="javax.swing.JTextField" binding="emailField">
  263. <constraints>
  264. <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">
  265. <preferred-size width="150" height="-1"/>
  266. </grid>
  267. </constraints>
  268. <properties>
  269. <text value=""/>
  270. </properties>
  271. </component>
  272. <component id="6fe91" class="javax.swing.JTextField" binding="studentClassField">
  273. <constraints>
  274. <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">
  275. <preferred-size width="150" height="-1"/>
  276. </grid>
  277. </constraints>
  278. <properties>
  279. <editable value="false"/>
  280. </properties>
  281. </component>
  282. <component id="3bf84" class="javax.swing.JLabel">
  283. <constraints>
  284. <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"/>
  285. </constraints>
  286. <properties>
  287. <text value="班级"/>
  288. </properties>
  289. </component>
  290. <hspacer id="1a595">
  291. <constraints>
  292. <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"/>
  293. </constraints>
  294. </hspacer>
  295. <hspacer id="b8bf3">
  296. <constraints>
  297. <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"/>
  298. </constraints>
  299. </hspacer>
  300. </children>
  301. </grid>
  302. </children>
  303. </grid>
  304. </children>
  305. </tabbedpane>
  306. </children>
  307. </grid>
  308. </children>
  309. </grid>
  310. </form>

4.2.2登录功能模块

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="ui.LoginWin">
  3.   <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">
  4.     <margin top="0" left="0" bottom="0" right="0"/>
  5.     <constraints>
  6.       <xy x="20" y="20" width="500" height="400"/>
  7.     </constraints>
  8.     <properties/>
  9.     <border type="none"/>
  10.     <children>
  11.       <component id="472d1" class="javax.swing.JTextField" binding="usernameTextField">
  12.         <constraints>
  13.           <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">
  14.             <preferred-size width="150" height="-1"/>
  15.           </grid>
  16.         </constraints>
  17.         <properties>
  18.           <text value=""/>
  19.         </properties>
  20.       </component>
  21.       <component id="dc459" class="javax.swing.JLabel">
  22.         <constraints>
  23.           <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"/>
  24.         </constraints>
  25.         <properties>
  26.           <text value="用户名"/>
  27.         </properties>
  28.       </component>
  29.       <hspacer id="77f66">
  30.         <constraints>
  31.           <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"/>
  32.         </constraints>
  33.       </hspacer>
  34.       <hspacer id="2ded4">
  35.         <constraints>
  36.           <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"/>
  37.         </constraints>
  38.       </hspacer>
  39.       <component id="5f2dd" class="javax.swing.JLabel">
  40.         <constraints>
  41.           <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"/>
  42.         </constraints>
  43.         <properties>
  44.           <text value="密码"/>
  45.         </properties>
  46.       </component>
  47.       <vspacer id="65983">
  48.         <constraints>
  49.           <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"/>
  50.         </constraints>
  51.       </vspacer>
  52.       <vspacer id="6bbef">
  53.         <constraints>
  54.           <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"/>
  55.         </constraints>
  56.       </vspacer>
  57.       <component id="e13f6" class="javax.swing.JPasswordField" binding="passwordTextField">
  58.         <constraints>
  59.           <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">
  60.             <preferred-size width="150" height="-1"/>
  61.           </grid>
  62.         </constraints>
  63.         <properties>
  64.           <text value=""/>
  65.         </properties>
  66.       </component>
  67.       <component id="4e649" class="javax.swing.JLabel" binding="titleLabel">
  68.         <constraints>
  69.           <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"/>
  70.         </constraints>
  71.         <properties>
  72.           <font name="YouYuan" size="28" style="0"/>
  73.           <foreground color="-7166023"/>
  74.           <text value="学生管理系统"/>
  75.         </properties>
  76.       </component>
  77.       <component id="1925b" class="javax.swing.JButton" binding="loginButton">
  78.         <constraints>
  79.           <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"/>
  80.         </constraints>
  81.         <properties>
  82.           <text value="登录"/>
  83.         </properties>
  84.       </component>
  85.       <component id="5b807" class="javax.swing.JButton" binding="resetBtn">
  86.         <constraints>
  87.           <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"/>
  88.         </constraints>
  89.         <properties>
  90.           <text value="重置"/>
  91.         </properties>
  92.       </component>
  93.     </children>
  94.   </grid>
  95.   <buttonGroups>
  96.     <group name="usertype">
  97.       <member id="99dfa"/>
  98.       <member id="94f54"/>
  99.       <member id="755f5"/>
  100.     </group>
  101.   </buttonGroups>
  102. </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课程设计结束了,从刚开始的不只如何下手到最后看到自己的程序按自己的想法运行,心里时不时的有一种喜悦。通过这两周的实验,我认识到书上和老师教的内容是有限的,要想掌握更多的知识我们必须多动脑,多思考,不断地靠自己去学习,同时我们还应向他人请教,从而了解更多自己不知道的知识。

通过这两周的编程我发现了自己的一些不足,在编写时经常犯一些低级错误,由于我们的马虎而浪费了不少时间。这些不足既然被发现就得在以后的做事中注意,争取改掉。

在这期间,经过努力我们掌握了一些基本的面向对象语言进行程序设计的技巧,更深的理解和运用结构化程序设计的思想和方法,掌握开发一个小型实用系统的基本方法,同时学会了一些调试一个较长程序的基本方法,提高了书写程序设计开发文档的能力(书写课程设计报告)。

这次的课程设计让我们受益匪浅,在此我们要感谢孜孜不倦指导我们的老师,感谢在困惑时给我们帮助的同学,感谢学校给我们一个这样动手动脑的机会,使我们在理论与实践相结合方面又得到了一次很好的锻炼,让我们得到很大的收获。

总之,我们会继续编写程序的,相信在越来越多的尝试之后,会不断进步不断提高的。

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号