精华内容
下载资源
问答
  • 目 录TOC \o "1-2" \h \z \u HYPERLINK \l "_Toc303696065" 1、开发背景 PAGEREF _Toc303696065 \h 2HYPERLINK \l "_Toc303696066" 2、系统描述 PAGEREF _Toc303696066 \h 2HYPERLINK \l "_Toc303696067" 3、数据...

    目 录

    TOC \o "1-2" \h \z \u HYPERLINK \l "_Toc303696065" 1、开发背景 PAGEREF _Toc303696065 \h 2

    HYPERLINK \l "_Toc303696066" 2、系统描述 PAGEREF _Toc303696066 \h 2

    HYPERLINK \l "_Toc303696067" 3、数据分析 PAGEREF _Toc303696067 \h 2

    HYPERLINK \l "_Toc303696068" 3.1、数据流图 PAGEREF _Toc303696068 \h 2

    HYPERLINK \l "_Toc303696069" 3.2、数据字典 PAGEREF _Toc303696069 \h 2

    HYPERLINK \l "_Toc303696070" 4、概念模型设计 PAGEREF _Toc303696070 \h 2

    HYPERLINK \l "_Toc303696071" 4.1E-R图 PAGEREF _Toc303696071 \h 2

    HYPERLINK \l "_Toc303696072" 5. 逻辑模型设计及优化 PAGEREF _Toc303696072 \h 2

    HYPERLINK \l "_Toc303696073" 5.1数据库表: PAGEREF _Toc303696073 \h 2

    HYPERLINK \l "_Toc303696074" 6、应用程序设计 PAGEREF _Toc303696074 \h 2

    HYPERLINK \l "_Toc303696075" 7、课程设计心得体会 PAGEREF _Toc303696075 \h 2

    1、开发背景

    90年代中期,由于Internet 的迅速普及,使Intranet成为Internet技术在企业管理信息系统中的应用和延伸,形成了集计算机,计算机网络、数据库、分布式计算等于一体的信息技术综合体,它打破了时间和地域的界限,使信息交流变得快捷、准确,为建立现代企业管理信息系统提供了充足的条件。企业信息管理系统在此基础上延伸、扩展,使之上下、内外全面贯通。随着Internet技术的兴起,对C/S结构的一种变化或者改进的结构。在这种结构下,用户界面完全通过WWW浏览器实现,一部分事务逻辑在前端实现,但是主要事务逻辑在服务器端实现,形成所谓3-tier结构。B/S结构,主要是利用了不断成熟的WWW浏览器技术,结合浏览器的多种Script语言(VBScript、JavaScript…)和ActiveX技术,用通用浏览器就实现了原来需要复杂专用软件才能实现的强大功能,并节约了开发成本,是一种全新的软件系统构造技术。随着Windows 98/Windows 2000将浏览器技术植入操作系统内部,这种结构更成为当今应用软件的首选体系结构。显然B/S结构应用程序相对于传统的C/S结构应用程序将是巨大的进步。

    2、系统描述

    经过调研及分析讨论,学生成绩管理系统主要完成以下功能:

    (1)学生个人信息维护:主要是完成学生个人信息的检索、修改,学生用户只能对自己的信息操作。

    (2)学生成绩检索:主要是完成学生个人成绩的查询,学生用户只能对自己的成绩进行检索。

    (3)老师个人信息维护:主要是完成老师个人信息的检索、修改,老师用户只能对自己的信息操作。

    (4)学生成绩维护: 主要是完成老师对任课课程的学生成绩进行检索、添加、修改,老师用户只能对自己任课课程的成绩进行操作。

    (5)学生信息维护:主要是完成管理员对所有学生信息的维护,包括条件检索、添加、修改、删除,该功能只能由管理员完成。

    (6)老师信息维护:主要是完成管理员对所有老师信息的维护,包括条件检索、添加、修改、删除,该功能只能由管理员完成。

    (7)课程信息维护:主要是完成管理员对课程的管理,包括检索课程,添加课程以及该课程任课老师和学习的学生。

    3、数据分析

    3.1、数据流图

    通过需求分析,得出学生成绩管理系统的教师业务处理数据流如图1所示。

    图1 教师业务数据流图

    3.2、数据字典

    (1)数据流的描述

    数据流编号: D01

    数据流名称: 用户名和密码

    简述:教师输入用户名和密码验证

    数据流来源:教师

    数据流去向:P01教师信息判断

    数据流组成:用户名和密码

    数据流量:50/天

    高峰流量:50/天

    (2)处理逻辑的描述

    处理逻辑编号:P01

    处理逻辑名称:教师登录权限判断

    简述:判断教师登录权限的合法性

    输入的数据流:教师的用户名和密码

    处理描述: 根据教师提供的同户名和密码,验证教师信息,验证通过则进入主页面,验证不通过则返回给教师信息指明为非法

    展开全文
  • 数据库学生成绩管理系统课程设计报告 数据库课程设计报告1.功能需求 本报告主要介绍学生成绩管理系统的数据库设计,从需求分析到数据库的运行与维护都 进行详细的叙述。该系统是利用 SQL 开发出来的。通过 SQL 建立...

    41528d3028836879cd698677c3999917.gif数据库学生成绩管理系统课程设计报告

    数据库课程设计报告1.功能需求 本报告主要介绍学生成绩管理系统的数据库设计,从需求分析到数据库的运行与维护都 进行详细的叙述。该系统是利用 SQL 开发出来的。通过 SQL 建立学生成绩管理系统,大大 方便和简化了数据的查询和处理,管理员可以通过 SQL 语言对表内数据进行添加,删除, 修改,查询等操作,还可以建立多用户,对其使用权限进行分配和回收。 报告分为 4部分,第一部分是课题简介及设计的内容与目的,需求分析,此阶段是数据 库设计的起点。第二部分是概念设计,逻辑结构设计,它是将需求分析的用户需求抽象为信 息结构,并将概念模型转换为某个 DBMS 所支持的数据模型。第三部分是数据库的实施与 运行,它包括数据的载入及数据困的运行和数据库和数据表的创建(代码) 。第四部分是课 程设计的总结。 1.1开发环境及开发语言 本次课程设计是以学生信息管理系统为模拟模型,运用 C++编程语言结合 SQL 数据库 所开发系统。开发平台为 VC6.0 和 SQL2008。 1.2 设计目的 随着学生数量的日益增多,学校对学生的管理要求也越来越高,为了使学生成绩的管理 更加系统化,数字化,因此我们设计了该学生信息管理系统。 1.3 设计内容 运用基于 E-R 模型的数据库设计方法和关系规范化理论做指导完成从系统的分析到设计 直至系统的最终实现,开发学生成绩管理系统,完成学生成绩管理系统的全部功能。首先做 好需求分析,并完成数据流图,其次做概念分析,利用实体联系的方法将需求分析的用户需 求抽象为信息结构,得到 E-R 图,然后就是逻辑结构设计,将 E-R 图转换为计算机系统所 支持的逻辑模型。最后利用 SQL 完成具体的实例。 1.4.需求分析 1、 问题的提出:为了高效率的完成学生成绩的管理,决定开发学生成绩管理系统。 2、 需完成的功能: (1) 能提供管理员及普通用户(除删除和修改)录入、注销、显示当前用户、修改、删 除、查询、输出,学生的档案信息,这些信息包括学生的成绩、课程、个人信息等。 (2) 触发器,索引,存储过程的建立及使用。 2. 概念设计 (1)(E-R图) Studen t Sname Sex Birthday Tel Sno Address Grade Score Politica Culture Cource Sno Cno Test User UserNm UserPw UserTyp (2)物理结构设计 Student Column Name Date Type Width 空值情况 Sno nchar 10 主关键字 Sname nchar 10 不为空 Sex nchar 10 不为空 Birthday numeric 10 可为空 Address nchar 10 可为空 Grade nchar 10 不为空 Po;itic nchar 10 不为空 Cuture nchar 10 不为空 Tel Nchar 10 不为空Cource Column Name Date Type Width 空值情况 Sno nchar 10 主关键字 Cno nchar 10 不为空 Score nchar 10 可为空 User Column Name Date Type Width 空值情况 User_name nchar 20 主关键字 User_Pswd nchar 20 不为空 User_Type int 可为空 (3)分析关系模式 对于关系模式 Student(Sno|Sname|Sex|Age|Address|Grade|class|Tel|Politic|Cuture )假定姓名 也具有唯一性,那么 Student 就有两个码,这两个码都由单个属性组成,彼此不相交。其它属性不存在对码的传递依赖与 部分依赖,又因为 Student 中除学号、姓名外没有其它的因素,所以 Student 属于 BCNF。对 于关系模式Cource(|Sno|Cno|Score|)有两个码,这两个码都由单个属性组成,彼此不相交, 其它属性不存在对码的传递依赖与部分依赖,又因为成绩中除学号、课程号外没有其它的决 定因素,所以成绩属于 BCNF。对于关系模式User(|UserName|UserType|UserPswd|)中, 它只有一个码,这里没有任何属性对课程号部分依赖或传递依赖,同时用户名是唯一的决定 因素,所以课程属于 BCNF。它和学生信息和成绩没有直接的联系,因此它是一张单独的表。 3.SQL 语句 3.1 创建表 学生表 create table Student ( Sno nchar(10) primary key,Sname nchar(10) not nullSex nchar(10) not null Age numeric(10) Address nchar(10)Class nchar(10) not null Grade nchar(10) not null Tel nchar(10) not null Politic nchar(10) not null Cuture nchar(10) not null ) 成绩表 create table Exam ( Sno nchar(10) primary key //主键约束Cno nchar(10) Not nullScore nchar(10) foreign key (Cno) references Course //外键约束 check(Score>=0) //完整性约束 ) 用户表 create table Teacher ( Username nchar(10) not nullUserPswd nchar(10) not nullUserType nchar(10) not null ) 3.2数据初始化 将学生类别加入表 Student 中 insert into Student values ( 000’,’张明’,’M’,’’,’哈尔滨’,’计科一班’,’大一’,’15880000’, ’无’,’群众’) insert into Student values( 001’,’李三’,’M’,’’,’长春’,’计科二班’,’大三’ ’15233000’.’无’, ’群众’) insert into Student values( 002’,’王强’,’M’,’’,’哈尔滨’,’软件二班’,’大二’ ’15850040’.’无’, ’群众’) insert into Student values( 003’,’张雪’,’F’,’’,’哈尔滨’,’软件一班’,’大一’ ’156809802’.’无’, ’群众’) insert into Student values( 004’,’李力’,’M’,’’,’大连’,’软件一班’,’大三’ ’15980000’.’无’, ’群众’)

    展开全文
  • 这个是我大三上学期的时候刚开始学习数据库课程的时候做的一个很稀烂的课程设计的源代码,当时刚刚开始学习Java和Oracle,而且当时就花了今年元旦3天假,做的这个C/S程序中没有加入触发器和存储过程等高级PL/SQL编程...

    这个是我大三上学期的时候刚开始学习数据库课程的时候做的一个很稀烂的课程设计的源代码,当时刚刚开始学习Java和Oracle,而且当时就花了今年元旦3天假,做的这个C/S程序中没有加入触发器和存储过程等高级PL/SQL编程,粗糙程度可见一斑。另外由于开始做的时候没注意,有一个致命硬伤:就是没有考虑级联更新的问题,导致有的时候不能删除表中的记录。当然在我这学期在闲下来的时候重新把这些地方都做了修改,因为修改的时候没有改这份文档(这篇文章中所有的代码都是直接从原始文档中复制粘贴的,而且因为我做的时候觉得比较简单,连代码的注释都没加),不过也算是很直观的看出我去年的水平是多么的稀烂。若干年以后,我再来看自己做的这个东西,我应该会笑自己当时为了赶时间做的这个要质量没质量,连很多Java控件都没搞清楚的学生成绩管理系统。

    用的后台数据库是:Oracle Database Enterprise Edition Release 10.2.0.1.0。数据库的SID:XSCJ,密码:qazwsx。

    堆代码用的IDE:Oracle JDeveloper 11g

    以下是数据库中建表以及添加表中数据的SQL脚本,我已经排好顺序,可以一次性运行。

    9310e85a14af99de4811ff4c77f1f911.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png//全部SQL语句731655954c7be9d8835ece551b5385f8.pngcreatetablestudent(

    731655954c7be9d8835ece551b5385f8.pngsnointnotnullprimarykey,

    731655954c7be9d8835ece551b5385f8.pngnamevarchar2(10)notnull,

    731655954c7be9d8835ece551b5385f8.pngsexvarchar2(3)notnull,

    731655954c7be9d8835ece551b5385f8.pngbirthday datenotnull,

    731655954c7be9d8835ece551b5385f8.pngclassvarchar2(5)

    731655954c7be9d8835ece551b5385f8.png);

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngcreatetableteacher(

    731655954c7be9d8835ece551b5385f8.pngtnointnotnullprimarykey,

    731655954c7be9d8835ece551b5385f8.pngnamevarchar2(10)notnull,

    731655954c7be9d8835ece551b5385f8.pngsexvarchar2(3)notnull,

    731655954c7be9d8835ece551b5385f8.pngbirthday datenotnull,

    731655954c7be9d8835ece551b5385f8.pngprofvarchar2(8)notnull,

    731655954c7be9d8835ece551b5385f8.pngdepartvarchar2(20)notnull731655954c7be9d8835ece551b5385f8.png);

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngcreatetablecourse(

    731655954c7be9d8835ece551b5385f8.pngcnovarchar2(6)notnullprimarykey,

    731655954c7be9d8835ece551b5385f8.pngcnamevarchar2(20)notnull,

    731655954c7be9d8835ece551b5385f8.pngtnointnotnull,

    731655954c7be9d8835ece551b5385f8.pngforeignkey(tno)referencesteacher(tno)

    731655954c7be9d8835ece551b5385f8.png);

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngcreatetablescore(

    731655954c7be9d8835ece551b5385f8.pngsnointnotnull,

    731655954c7be9d8835ece551b5385f8.pngcnovarchar2(6)notnull,

    731655954c7be9d8835ece551b5385f8.pngdegreeint,

    731655954c7be9d8835ece551b5385f8.pngforeignkey(sno)referencesstudent(sno),

    731655954c7be9d8835ece551b5385f8.pngforeignkey(cno)referencescourse(cno)

    731655954c7be9d8835ece551b5385f8.png);

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngcreatetableusers(

    731655954c7be9d8835ece551b5385f8.pnguserIDvarchar2(20)primarykey,

    731655954c7be9d8835ece551b5385f8.pngpasswordvarchar2(20)notnull,

    731655954c7be9d8835ece551b5385f8.pngquanxianintnotnull,

    731655954c7be9d8835ece551b5385f8.pngconstraintquanxian_setcheck(quanxian>=1andquanxian<=2)

    731655954c7be9d8835ece551b5385f8.png)

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pnginsertintousersvalues(

    731655954c7be9d8835ece551b5385f8.png'Derek','123456',2);

    731655954c7be9d8835ece551b5385f8.pnginsertintousersvalues(

    731655954c7be9d8835ece551b5385f8.png'洪志恒','123456',1);

    731655954c7be9d8835ece551b5385f8.pnginsertintousersvalues(

    731655954c7be9d8835ece551b5385f8.png'马新星','123456',1);

    731655954c7be9d8835ece551b5385f8.pnginsertintousersvalues(

    731655954c7be9d8835ece551b5385f8.png'方雨阳','123456',2);

    731655954c7be9d8835ece551b5385f8.pnginsertintousersvalues(

    731655954c7be9d8835ece551b5385f8.png'董响','123456',2);

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pnginsertintostudentvalues731655954c7be9d8835ece551b5385f8.png(101,'曾华','男',to_date('1987-09-01','YYYY-MM-DD'),'95033');

    731655954c7be9d8835ece551b5385f8.pnginsertintostudentvalues731655954c7be9d8835ece551b5385f8.png(102,'匡明','男',to_date('1985-10-02','YYYY-MM-DD'),'95031');

    731655954c7be9d8835ece551b5385f8.pnginsertintostudentvalues731655954c7be9d8835ece551b5385f8.png(103,'王丽','女',to_date('1986-02-23','YYYY-MM-DD'),'95033');

    731655954c7be9d8835ece551b5385f8.pnginsertintostudentvalues731655954c7be9d8835ece551b5385f8.png(104,'李军','男',to_date('1986-02-02','YYYY-MM-DD'),'95033');

    731655954c7be9d8835ece551b5385f8.pnginsertintostudentvalues731655954c7be9d8835ece551b5385f8.png(105,'王芳','女',to_date('1985-02-10','YYYY-MM-DD'),'95031');

    731655954c7be9d8835ece551b5385f8.pnginsertintostudentvalues731655954c7be9d8835ece551b5385f8.png(106,'陆君','男',to_date('1984-06-03','YYYY-MM-DD'),'95031');

    731655954c7be9d8835ece551b5385f8.pnginsertintostudentvalues731655954c7be9d8835ece551b5385f8.png(107,'李强','男',to_date('1986-02-02','YYYY-MM-DD'),'95033');

    731655954c7be9d8835ece551b5385f8.pnginsertintostudentvalues731655954c7be9d8835ece551b5385f8.png(108,'赵红','女',to_date('1985-02-10','YYYY-MM-DD'),'95034');

    731655954c7be9d8835ece551b5385f8.pnginsertintostudentvalues731655954c7be9d8835ece551b5385f8.png(109,'张伟','男',to_date('1984-06-03','YYYY-MM-DD'),'95035');

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pnginsertintoteachervalues731655954c7be9d8835ece551b5385f8.png(804,'李诚','男',to_date('1968-12-02','YYYY-MM-DD'),'副教授','计算机系');

    731655954c7be9d8835ece551b5385f8.pnginsertintoteachervalues731655954c7be9d8835ece551b5385f8.png(856,'张旭','男',to_date('1975-09-02','YYYY-MM-DD'),'讲师','电子工程系');

    731655954c7be9d8835ece551b5385f8.pnginsertintoteachervalues731655954c7be9d8835ece551b5385f8.png(825,'王萍','女',to_date('1978-05-08','YYYY-MM-DD'),'助教','计算机系');

    731655954c7be9d8835ece551b5385f8.pnginsertintoteachervalues731655954c7be9d8835ece551b5385f8.png(831,'刘冰','女',to_date('1979-08-10','YYYY-MM-DD'),'助教','电子工程系');

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pnginsertintocoursevalues731655954c7be9d8835ece551b5385f8.png('3-105','计算机导论',825);

    731655954c7be9d8835ece551b5385f8.pnginsertintocoursevalues731655954c7be9d8835ece551b5385f8.png('3-245','操作系统',804);

    731655954c7be9d8835ece551b5385f8.pnginsertintocoursevalues731655954c7be9d8835ece551b5385f8.png('6-166','数字电路',856);

    731655954c7be9d8835ece551b5385f8.pnginsertintocoursevalues731655954c7be9d8835ece551b5385f8.png('9-888','高等数学',831);

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pnginsertintoscorevalues(103,'3-245',86);

    731655954c7be9d8835ece551b5385f8.pnginsertintoscorevalues(105,'3-245',75);

    731655954c7be9d8835ece551b5385f8.pnginsertintoscorevalues(109,'3-245',68);

    731655954c7be9d8835ece551b5385f8.pnginsertintoscorevalues(103,'3-105',92);

    731655954c7be9d8835ece551b5385f8.pnginsertintoscorevalues(105,'3-105',88);

    731655954c7be9d8835ece551b5385f8.pnginsertintoscorevalues(109,'3-105',76);

    731655954c7be9d8835ece551b5385f8.pnginsertintoscorevalues(101,'3-105',64);

    731655954c7be9d8835ece551b5385f8.pnginsertintoscorevalues(107,'3-105',91);

    731655954c7be9d8835ece551b5385f8.pnginsertintoscorevalues(108,'3-105',78);

    731655954c7be9d8835ece551b5385f8.pnginsertintoscorevalues(101,'6-166',85);

    731655954c7be9d8835ece551b5385f8.pnginsertintoscorevalues(107,'6-166',79);

    731655954c7be9d8835ece551b5385f8.pnginsertintoscorevalues(108,'6-166',81);

    731655954c7be9d8835ece551b5385f8.png

    以下是所有Java源代码,一共将近20个.java文件。

    9310e85a14af99de4811ff4c77f1f911.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png//Login.java731655954c7be9d8835ece551b5385f8.pngpackageXSCJ;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Dimension;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Toolkit;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JFrame;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.UIManager;

    731655954c7be9d8835ece551b5385f8.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png

    9310e85a14af99de4811ff4c77f1f911.pngpublicclassLogin222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicLogin()222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png        JFrame frame=newFrame1();

    1408c5260b2f05e450dee929db9be5f7.png        Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();

    1408c5260b2f05e450dee929db9be5f7.png        Dimension frameSize=frame.getSize();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(frameSize.height>screenSize.height)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            frameSize.height=screenSize.height;

    5bcb1807ee3e00d2b3c225f0b3f5c751.png        }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(frameSize.width>screenSize.width)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            frameSize.width=screenSize.width;

    5bcb1807ee3e00d2b3c225f0b3f5c751.png        }1408c5260b2f05e450dee929db9be5f7.png        frame.setLocation((screenSize.width-frameSize.width)/2,

    1408c5260b2f05e450dee929db9be5f7.png                          (screenSize.height-frameSize.height)/2);

    1408c5260b2f05e450dee929db9be5f7.png        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    1408c5260b2f05e450dee929db9be5f7.png        frame.setVisible(true);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicstaticvoidmain(String[] args)222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png        }1408c5260b2f05e450dee929db9be5f7.pngnewLogin();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }f466905a3bcb5dcef110eab799825254.png}731655954c7be9d8835ece551b5385f8.png

    9310e85a14af99de4811ff4c77f1f911.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png//Frame1.java731655954c7be9d8835ece551b5385f8.pngpackageXSCJ;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Dimension;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Rectangle;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionEvent;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionListener;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.util.Vector;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JButton;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JCheckBox;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JComboBox;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JFrame;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JLabel;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JList;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenu;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenuBar;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenuItem;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JOptionPane;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JPasswordField;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.*;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JRadioButton;

    731655954c7be9d8835ece551b5385f8.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png

    9310e85a14af99de4811ff4c77f1f911.pngpublicclassFrame1extendsJFrame222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png    Vector v=newVector();

    1408c5260b2f05e450dee929db9be5f7.pngcharstr[]=newchar[20];

    1408c5260b2f05e450dee929db9be5f7.png    String username=newString();

    1408c5260b2f05e450dee929db9be5f7.png    String password=newString();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenuBar menuBar=newJMenuBar();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenu menuFile=newJMenu();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenuItem menuFileExit=newJMenuItem();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenu menuHelp=newJMenu();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenuItem menuHelpAbout=newJMenuItem();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel textWelcome=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel textUserName=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel textPassword=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJPasswordField inputPassword=newJPasswordField();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJComboBox chooseUser=newJComboBox(v);

    1408c5260b2f05e450dee929db9be5f7.pngprivateJButton loginIn=newJButton();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel jLabel2=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicFrame1()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            jbInit();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidjbInit()throwsException222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png

    1408c5260b2f05e450dee929db9be5f7.png        Connection conn=null;

    1408c5260b2f05e450dee929db9be5f7.png        Statement state=null;

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            Class.forName("oracle.jdbc.OracleDriver").newInstance();

    1408c5260b2f05e450dee929db9be5f7.png            conn=1408c5260b2f05e450dee929db9be5f7.pngDriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XSCJ","system",

    1408c5260b2f05e450dee929db9be5f7.png"qazwsx");

    1408c5260b2f05e450dee929db9be5f7.png            state=conn.createStatement();

    1408c5260b2f05e450dee929db9be5f7.png            ResultSet rs=state.executeQuery("select userID from users");

    1408c5260b2f05e450dee929db9be5f7.pngwhile(rs.next())

    1408c5260b2f05e450dee929db9be5f7.png                v.addElement(rs.getString("userID"));

    1408c5260b2f05e450dee929db9be5f7.png            rs.close();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(SQLException e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            System.out.println("Error Code="+e.getErrorCode());

    1408c5260b2f05e450dee929db9be5f7.png            System.out.println("Error Message="+e.getMessage());

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }finally222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(state!=null)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    state.close();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(conn!=null)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    conn.close();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png            }catch(SQLException e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                System.out.println("Error Code="+e.getErrorCode());

    1408c5260b2f05e450dee929db9be5f7.png                System.out.println("Error Message="+e.getMessage());

    5bcb1807ee3e00d2b3c225f0b3f5c751.png            }5bcb1807ee3e00d2b3c225f0b3f5c751.png        }1408c5260b2f05e450dee929db9be5f7.pngthis.setTitle("学生成绩管理系统");

    1408c5260b2f05e450dee929db9be5f7.pngthis.setJMenuBar(menuBar);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().setLayout(null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.setSize(newDimension(400,300));

    1408c5260b2f05e450dee929db9be5f7.png        menuFile.setText("File");

    1408c5260b2f05e450dee929db9be5f7.png        menuFileExit.setText("Exit");

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        menuFileExit.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent ae)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    fileExit_ActionPerformed(ae);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        menuHelp.setText("Help");

    1408c5260b2f05e450dee929db9be5f7.png        menuHelpAbout.setText("About");

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        menuHelpAbout.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent ae)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    helpAbout_ActionPerformed(ae);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        textWelcome.setText("欢迎使用学生成绩管理系统");

    1408c5260b2f05e450dee929db9be5f7.png        textWelcome.setBounds(newRectangle(120,30,150,40));

    1408c5260b2f05e450dee929db9be5f7.png        textUserName.setText("用户名:");

    1408c5260b2f05e450dee929db9be5f7.png        textUserName.setBounds(newRectangle(60,80,60,25));

    1408c5260b2f05e450dee929db9be5f7.png        textPassword.setText("密  码:");

    1408c5260b2f05e450dee929db9be5f7.png        textPassword.setBounds(newRectangle(60,105,60,25));

    1408c5260b2f05e450dee929db9be5f7.png        inputPassword.setBounds(newRectangle(120,105,95,25));

    1408c5260b2f05e450dee929db9be5f7.png        chooseUser.setBounds(newRectangle(120,80,95,25));

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        chooseUser.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    chooseUser_actionPerformed(e);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        loginIn.setText("登 陆");

    1408c5260b2f05e450dee929db9be5f7.png        loginIn.setBounds(newRectangle(250,100,95,30));

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        loginIn.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    loginIn_actionPerformed(e);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        jLabel2.setText("严禁未经授权使用此系统, 否则可能会面临民事和刑事起诉。");

    1408c5260b2f05e450dee929db9be5f7.png        jLabel2.setBounds(newRectangle(45,195,325,25));

    1408c5260b2f05e450dee929db9be5f7.png        menuFile.add(menuFileExit);

    1408c5260b2f05e450dee929db9be5f7.png        menuBar.add(menuFile);

    1408c5260b2f05e450dee929db9be5f7.png        menuHelp.add(menuHelpAbout);

    1408c5260b2f05e450dee929db9be5f7.png        menuBar.add(menuHelp);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(jLabel2,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(loginIn,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(chooseUser,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(inputPassword,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(textPassword,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(textUserName,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(textWelcome,null);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngvoidfileExit_ActionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png        System.exit(0);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngvoidhelpAbout_ActionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png        JOptionPane.showMessageDialog(this,newFrame1_AboutBoxPanel1(),

    1408c5260b2f05e450dee929db9be5f7.png"About", JOptionPane.PLAIN_MESSAGE);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngvoidchooseUser_actionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png        username=(String)chooseUser.getSelectedItem();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidloginIn_actionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngchar[] str=inputPassword.getPassword();

    1408c5260b2f05e450dee929db9be5f7.png        password=newString(str);

    1408c5260b2f05e450dee929db9be5f7.pngwhile(password.length()<20)

    1408c5260b2f05e450dee929db9be5f7.png            password+="";

    1408c5260b2f05e450dee929db9be5f7.png        Connection conn=null;

    1408c5260b2f05e450dee929db9be5f7.png        Statement state=null;

    1408c5260b2f05e450dee929db9be5f7.png        ResultSet rs;

    1408c5260b2f05e450dee929db9be5f7.png        String password_get=newString("");

    1408c5260b2f05e450dee929db9be5f7.pngintquanxian_get=1;

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            Class.forName("oracle.jdbc.OracleDriver").newInstance();

    1408c5260b2f05e450dee929db9be5f7.png            conn=1408c5260b2f05e450dee929db9be5f7.pngDriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XSCJ","system",

    1408c5260b2f05e450dee929db9be5f7.png"qazwsx");

    1408c5260b2f05e450dee929db9be5f7.png            state=conn.createStatement();

    1408c5260b2f05e450dee929db9be5f7.png            rs=1408c5260b2f05e450dee929db9be5f7.png state.executeQuery("select password,quanxian from users where userID='"+1408c5260b2f05e450dee929db9be5f7.png                    username+"'");

    1408c5260b2f05e450dee929db9be5f7.png            rs.next();

    1408c5260b2f05e450dee929db9be5f7.png            password_get=rs.getString("password");

    1408c5260b2f05e450dee929db9be5f7.png            quanxian_get=rs.getInt("quanxian");

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(SQLException e1)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            System.out.println("Error Code="+e1.getErrorCode());

    1408c5260b2f05e450dee929db9be5f7.png            System.out.println("Error Message="+e1.getMessage());

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e1)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e1.printStackTrace();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }finally222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(state!=null)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    state.close();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(conn!=null)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    conn.close();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png            }catch(SQLException e1)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                System.out.println("Error Code="+e1.getErrorCode());

    1408c5260b2f05e450dee929db9be5f7.png                System.out.println("Error Message="+e1.getMessage());

    5bcb1807ee3e00d2b3c225f0b3f5c751.png            }5bcb1807ee3e00d2b3c225f0b3f5c751.png        }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(password_get.equals(password)==false)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            System.exit(0);

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }elseif(quanxian_get>1)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngthis.dispose();

    1408c5260b2f05e450dee929db9be5f7.pngnewmainWindowAdmin().setVisible(true);

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }else222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngthis.dispose();

    1408c5260b2f05e450dee929db9be5f7.pngnewmainWindowNormal().setVisible(true);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }f466905a3bcb5dcef110eab799825254.png}731655954c7be9d8835ece551b5385f8.png

    9310e85a14af99de4811ff4c77f1f911.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png//Frame1_AboutBoxPanel1.java731655954c7be9d8835ece551b5385f8.pngpackageXSCJ;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.GridBagConstraints;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.GridBagLayout;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Insets;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.BorderFactory;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JLabel;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JPanel;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.border.Border;

    731655954c7be9d8835ece551b5385f8.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png

    9310e85a14af99de4811ff4c77f1f911.pngpublicclassFrame1_AboutBoxPanel1extendsJPanel222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel labelTitle=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel labelAuthor=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel labelStudentNumber=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel labelEmail=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel labelCompany=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateGridBagLayout layoutMain=newGridBagLayout();

    1408c5260b2f05e450dee929db9be5f7.pngprivateBorder border=BorderFactory.createEtchedBorder();

    1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicFrame1_AboutBoxPanel1()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            jbInit();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidjbInit()throwsException222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngthis.setLayout(layoutMain);

    1408c5260b2f05e450dee929db9be5f7.pngthis.setBorder(border);

    1408c5260b2f05e450dee929db9be5f7.png        labelTitle.setText("学生成绩管理系统 V0.5");

    1408c5260b2f05e450dee929db9be5f7.png        labelAuthor.setText("Derek");

    1408c5260b2f05e450dee929db9be5f7.png        labelStudentNumber.setText("");

    1408c5260b2f05e450dee929db9be5f7.png        labelEmail.setText("@hotmail.com");

    1408c5260b2f05e450dee929db9be5f7.png        labelCompany.setText("");

    1408c5260b2f05e450dee929db9be5f7.pngthis.add(labelTitle,

    1408c5260b2f05e450dee929db9be5f7.pngnewGridBagConstraints(0,0,1,1,0.0,0.0, GridBagConstraints.WEST,

    1408c5260b2f05e450dee929db9be5f7.png                                        GridBagConstraints.NONE,

    1408c5260b2f05e450dee929db9be5f7.pngnewInsets(5,15,0,15),0,0));

    1408c5260b2f05e450dee929db9be5f7.pngthis.add(labelAuthor,

    1408c5260b2f05e450dee929db9be5f7.pngnewGridBagConstraints(0,1,1,1,0.0,0.0, GridBagConstraints.WEST,

    1408c5260b2f05e450dee929db9be5f7.png                                        GridBagConstraints.NONE,

    1408c5260b2f05e450dee929db9be5f7.pngnewInsets(0,15,0,15),0,0));

    1408c5260b2f05e450dee929db9be5f7.pngthis.add(labelStudentNumber,

    1408c5260b2f05e450dee929db9be5f7.pngnewGridBagConstraints(0,2,1,1,0.0,0.0,

    1408c5260b2f05e450dee929db9be5f7.png                                        GridBagConstraints.WEST,

    1408c5260b2f05e450dee929db9be5f7.png                                        GridBagConstraints.NONE,

    1408c5260b2f05e450dee929db9be5f7.pngnewInsets(0,15,0,15),0,0));

    1408c5260b2f05e450dee929db9be5f7.pngthis.add(labelEmail,

    1408c5260b2f05e450dee929db9be5f7.pngnewGridBagConstraints(0,3,1,1,0.0,0.0, GridBagConstraints.WEST,

    1408c5260b2f05e450dee929db9be5f7.png                                        GridBagConstraints.NONE,

    1408c5260b2f05e450dee929db9be5f7.pngnewInsets(0,15,0,15),0,0));

    1408c5260b2f05e450dee929db9be5f7.pngthis.add(labelCompany,

    1408c5260b2f05e450dee929db9be5f7.pngnewGridBagConstraints(0,4,1,1,0.0,0.0, GridBagConstraints.WEST,

    1408c5260b2f05e450dee929db9be5f7.png                                        GridBagConstraints.NONE,

    1408c5260b2f05e450dee929db9be5f7.pngnewInsets(0,15,5,15),0,0));

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }f466905a3bcb5dcef110eab799825254.png}731655954c7be9d8835ece551b5385f8.png

    9310e85a14af99de4811ff4c77f1f911.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png//mainWindowAdmin.java731655954c7be9d8835ece551b5385f8.pngpackageXSCJ;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Dimension;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Rectangle;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionEvent;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionListener;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Connection;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.DriverManager;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.ResultSet;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.SQLException;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Statement;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.util.Vector;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JButton;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JComboBox;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JEditorPane;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JFrame;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JLabel;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png

    9310e85a14af99de4811ff4c77f1f911.pngpublicclassmainWindowAdminextendsJFrame222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png    String operation;

    1408c5260b2f05e450dee929db9be5f7.png    String table;

    1408c5260b2f05e450dee929db9be5f7.png//v1.addElement("查询、更新、删除");715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngString[] choose_operation=222530190136c9c4cfd237cc0d5cff99.png{"查询、修改、删除","插入"};

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png    String[] choose_table=222530190136c9c4cfd237cc0d5cff99.png{"学生信息","教师信息","课程信息","成绩信息"};

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png    String[] s=222530190136c9c4cfd237cc0d5cff99.png{"选课情况","教学情况"};

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel jLabel1=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel jLabel2=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel jLabel3=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel jLabel4=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJButton jButton1=newJButton();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJButton jButton2=newJButton();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJButton jButton3=newJButton();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJButton jButton4=newJButton();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJButton jButton5=newJButton();

    1408c5260b2f05e450dee929db9be5f7.png    JComboBox chooseOperation=newJComboBox(choose_operation);

    1408c5260b2f05e450dee929db9be5f7.png    JComboBox chooseTable=newJComboBox(choose_table);

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel jLabel5=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJComboBox findInformation=newJComboBox(s);

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel jLabel6=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJButton jButton6=newJButton();

    1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicmainWindowAdmin()222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            jbInit();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidjbInit()throwsException222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().setLayout(null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.setSize(newDimension(443,388));

    1408c5260b2f05e450dee929db9be5f7.pngthis.setTitle("欢迎使用学生成绩管理系统 V0.5");

    1408c5260b2f05e450dee929db9be5f7.png        jLabel1.setText("请选择操作:");

    1408c5260b2f05e450dee929db9be5f7.png        jLabel1.setBounds(newRectangle(50,195,90,20));

    1408c5260b2f05e450dee929db9be5f7.png        jLabel2.setText("请选择数据表:");

    1408c5260b2f05e450dee929db9be5f7.png        jLabel2.setBounds(newRectangle(50,220,90,20));

    1408c5260b2f05e450dee929db9be5f7.png        jLabel3.setText("修改数据:");

    1408c5260b2f05e450dee929db9be5f7.png        jLabel3.setBounds(newRectangle(30,170,160,20));

    1408c5260b2f05e450dee929db9be5f7.png        jLabel4.setText("查看数据:");

    1408c5260b2f05e450dee929db9be5f7.png        jLabel4.setBounds(newRectangle(30,30,115,25));

    1408c5260b2f05e450dee929db9be5f7.png        jButton1.setText("学生信息");

    1408c5260b2f05e450dee929db9be5f7.png        jButton1.setBounds(newRectangle(105,65,80,35));

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        jButton1.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    jButton1_actionPerformed(e);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        jButton2.setText("教师信息");

    1408c5260b2f05e450dee929db9be5f7.png        jButton2.setBounds(newRectangle(210,65,80,35));

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        jButton2.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    jButton2_actionPerformed(e);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        jButton3.setText("课程信息");

    1408c5260b2f05e450dee929db9be5f7.png        jButton3.setBounds(newRectangle(105,115,80,35));

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        jButton3.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    jButton3_actionPerformed(e);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        jButton4.setText("成绩信息");

    1408c5260b2f05e450dee929db9be5f7.png        jButton4.setBounds(newRectangle(210,115,80,35));

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        jButton4.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    jButton4_actionPerformed(e);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        jButton5.setText("GO");

    1408c5260b2f05e450dee929db9be5f7.png        jButton5.setBounds(newRectangle(300,220,75,20));

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        jButton5.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    jButton5_actionPerformed(e);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        chooseOperation.setBounds(newRectangle(140,195,130,20));

    1408c5260b2f05e450dee929db9be5f7.png        chooseTable.setBounds(newRectangle(140,220,130,20));

    1408c5260b2f05e450dee929db9be5f7.png        jLabel5.setText("高级查询:");

    1408c5260b2f05e450dee929db9be5f7.png        jLabel5.setBounds(newRectangle(50,290,90,20));

    1408c5260b2f05e450dee929db9be5f7.png        findInformation.setBounds(newRectangle(140,290,130,20));

    1408c5260b2f05e450dee929db9be5f7.png        jLabel6.setText("附加功能:");

    1408c5260b2f05e450dee929db9be5f7.png        jLabel6.setBounds(newRectangle(30,270,110,15));

    1408c5260b2f05e450dee929db9be5f7.png        jButton6.setText("GO");

    1408c5260b2f05e450dee929db9be5f7.png        jButton6.setBounds(newRectangle(300,290,80,20));

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        jButton6.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    jButton6_actionPerformed(e);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(jButton6,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(jLabel6,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(findInformation,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(jLabel5,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(chooseTable,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(chooseOperation,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(jButton5,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(jButton4,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(jButton3,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(jButton2,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(jButton1,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(jLabel4,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(jLabel3,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(jLabel2,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(jLabel1,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngvoidjButton1_actionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngnewstudentInformation().setVisible(true);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngvoidjButton2_actionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngnewteacherInformation().setVisible(true);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngvoidjButton3_actionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngnewcourseInformation().setVisible(true);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngvoidjButton4_actionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngnewscoreInformation().setVisible(true);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidjButton5_actionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png        operation=(String)chooseOperation.getSelectedItem();

    1408c5260b2f05e450dee929db9be5f7.png        table=(String)chooseTable.getSelectedItem();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(operation.equals("查询、修改、删除"))222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngif(table.equals("学生信息"))

    1408c5260b2f05e450dee929db9be5f7.pngnewstudentUpdate().setVisible(true);

    1408c5260b2f05e450dee929db9be5f7.pngelseif(table.equals("教师信息"))

    1408c5260b2f05e450dee929db9be5f7.pngnewteacherUpdate().setVisible(true);

    1408c5260b2f05e450dee929db9be5f7.pngelseif(table.equals("课程信息"))

    1408c5260b2f05e450dee929db9be5f7.pngnewcourseUpdate().setVisible(true);

    1408c5260b2f05e450dee929db9be5f7.pngelse1408c5260b2f05e450dee929db9be5f7.pngnewscoreUpdate().setVisible(true);

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }else222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngif(table.equals("学生信息"))

    1408c5260b2f05e450dee929db9be5f7.pngnewinsertStudent().setVisible(true);

    1408c5260b2f05e450dee929db9be5f7.pngelseif(table.equals("教师信息"))

    1408c5260b2f05e450dee929db9be5f7.pngnewinsertTeacher().setVisible(true);

    1408c5260b2f05e450dee929db9be5f7.pngelseif(table.equals("课程信息"))

    1408c5260b2f05e450dee929db9be5f7.pngnewinsertCourse().setVisible(true);

    1408c5260b2f05e450dee929db9be5f7.pngelse1408c5260b2f05e450dee929db9be5f7.pngnewinsertScore().setVisible(true);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidjButton6_actionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png        String information=(String)findInformation.getSelectedItem();

    1408c5260b2f05e450dee929db9be5f7.pngif(information.equals("选课情况"))

    1408c5260b2f05e450dee929db9be5f7.pngnewselect1().setVisible(true);

    1408c5260b2f05e450dee929db9be5f7.pngelse1408c5260b2f05e450dee929db9be5f7.pngnewselect2().setVisible(true);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }f466905a3bcb5dcef110eab799825254.png}731655954c7be9d8835ece551b5385f8.png

    9310e85a14af99de4811ff4c77f1f911.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png//mainWindowNormal.java731655954c7be9d8835ece551b5385f8.pngpackageXSCJ;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Dimension;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Rectangle;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionEvent;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionListener;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JButton;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JFrame;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JLabel;

    731655954c7be9d8835ece551b5385f8.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png

    9310e85a14af99de4811ff4c77f1f911.pngpublicclassmainWindowNormalextendsJFrame222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngprivateJButton student=newJButton();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJButton teacher=newJButton();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJButton course=newJButton();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJButton score=newJButton();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel welcome=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJLabel explain=newJLabel();

    1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicmainWindowNormal()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            jbInit();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidjbInit()throwsException222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().setLayout(null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.setSize(newDimension(400,300));

    1408c5260b2f05e450dee929db9be5f7.pngthis.setTitle("欢迎使用学生成绩管理系统 V0.5");

    1408c5260b2f05e450dee929db9be5f7.png        student.setText("学生信息");

    1408c5260b2f05e450dee929db9be5f7.png        student.setBounds(newRectangle(70,105,105,35));

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        student.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    student_actionPerformed(e);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        teacher.setText("教师信息");

    1408c5260b2f05e450dee929db9be5f7.png        teacher.setBounds(newRectangle(195,105,105,35));

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        teacher.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    teacher_actionPerformed(e);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        course.setText("课程信息");

    1408c5260b2f05e450dee929db9be5f7.png        course.setBounds(newRectangle(70,160,105,35));

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        course.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    course_actionPerformed(e);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        score.setText("成绩信息");

    1408c5260b2f05e450dee929db9be5f7.png        score.setBounds(newRectangle(195,160,105,35));

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        score.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    score_actionPerformed(e);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        welcome.setText("欢迎使用学生成绩管理系统");

    1408c5260b2f05e450dee929db9be5f7.png        welcome.setBounds(newRectangle(110,60,150,35));

    1408c5260b2f05e450dee929db9be5f7.png        explain.setText("普通用户仅具有查看表数据权限");

    1408c5260b2f05e450dee929db9be5f7.png        explain.setBounds(newRectangle(100,215,185,25));

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(explain,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(welcome,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(score,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(course,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(teacher,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(student,null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidstudent_actionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngnewstudentInformation().setVisible(true);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidteacher_actionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngnewteacherInformation().setVisible(true);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidcourse_actionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngnewcourseInformation().setVisible(true);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidscore_actionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngnewscoreInformation().setVisible(true);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }f466905a3bcb5dcef110eab799825254.png}731655954c7be9d8835ece551b5385f8.png

    9310e85a14af99de4811ff4c77f1f911.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png//studentInformation.java731655954c7be9d8835ece551b5385f8.pngpackageXSCJ;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Dimension;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Rectangle;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionEvent;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionListener;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Connection;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Date;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.DriverManager;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.ResultSet;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.SQLException;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Statement;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Timestamp;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.util.Vector;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JFrame;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JList;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenu;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenuBar;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenuItem;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JScrollPane;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JTable;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.RowSorter;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.table.DefaultTableModel;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.table.TableRowSorter;

    731655954c7be9d8835ece551b5385f8.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png

    9310e85a14af99de4811ff4c77f1f911.pngpublicclassstudentInformationextendsJFrame222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png    String[] column=222530190136c9c4cfd237cc0d5cff99.png{"学号","学生姓名","学生性别","出生日期","班级"};

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenuBar menuBar=newJMenuBar();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenu menuFile=newJMenu();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenuItem menuFileExit=newJMenuItem();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJTable studentTable=newJTable();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png    DefaultTableModel mm=newDefaultTableModel(column,0)222530190136c9c4cfd237cc0d5cff99.png{

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    };

    1408c5260b2f05e450dee929db9be5f7.png

    1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicstudentInformation()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            jbInit();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidjbInit()throwsException222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngthis.setJMenuBar(menuBar);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().setLayout(null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.setSize(newDimension(491,391));

    1408c5260b2f05e450dee929db9be5f7.pngthis.setTitle("学生信息");

    1408c5260b2f05e450dee929db9be5f7.png        menuFile.setText("File");

    1408c5260b2f05e450dee929db9be5f7.png        menuFileExit.setText("Exit");

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        menuFileExit.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent ae)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    fileExit_ActionPerformed(ae);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        studentTable.setBounds(newRectangle(25,25,435,290));

    1408c5260b2f05e450dee929db9be5f7.png        menuFile.add(menuFileExit);

    1408c5260b2f05e450dee929db9be5f7.png        menuBar.add(menuFile);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(studentTable,null);

    1408c5260b2f05e450dee929db9be5f7.pngintstudentNumber;

    1408c5260b2f05e450dee929db9be5f7.png        String studentName, studentSex, studentClass;

    1408c5260b2f05e450dee929db9be5f7.png        Date studentBirthday;

    1408c5260b2f05e450dee929db9be5f7.png

    1408c5260b2f05e450dee929db9be5f7.png        Connection conn=null;

    1408c5260b2f05e450dee929db9be5f7.png        Statement state=null;

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            Class.forName("oracle.jdbc.OracleDriver").newInstance();

    1408c5260b2f05e450dee929db9be5f7.png            conn=1408c5260b2f05e450dee929db9be5f7.pngDriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XSCJ","system",

    1408c5260b2f05e450dee929db9be5f7.png"qazwsx");

    1408c5260b2f05e450dee929db9be5f7.png            state=conn.createStatement();

    1408c5260b2f05e450dee929db9be5f7.png            ResultSet rs=state.executeQuery("select * from student");

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngwhile(rs.next())222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                studentNumber=rs.getInt("sno");

    1408c5260b2f05e450dee929db9be5f7.png                studentName=rs.getString("name");

    1408c5260b2f05e450dee929db9be5f7.png                studentSex=rs.getString("sex");

    1408c5260b2f05e450dee929db9be5f7.png                studentBirthday=rs.getDate("birthday");

    1408c5260b2f05e450dee929db9be5f7.png                studentClass=rs.getString("class");

    1408c5260b2f05e450dee929db9be5f7.png                Object[] studentInfo=715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png222530190136c9c4cfd237cc0d5cff99.png{ studentNumber, studentName, studentSex, studentBirthday,

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                  studentClass };

    1408c5260b2f05e450dee929db9be5f7.png                mm.addRow(studentInfo);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png            }1408c5260b2f05e450dee929db9be5f7.png            studentTable.setModel(mm);

    1408c5260b2f05e450dee929db9be5f7.png            rs.close();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(SQLException e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            System.out.println("Error Code="+e.getErrorCode());

    1408c5260b2f05e450dee929db9be5f7.png            System.out.println("Error Message="+e.getMessage());

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }finally222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(state!=null)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    state.close();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(conn!=null)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    conn.close();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png            }catch(SQLException e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                System.out.println("Error Code="+e.getErrorCode());

    1408c5260b2f05e450dee929db9be5f7.png                System.out.println("Error Message="+e.getMessage());

    5bcb1807ee3e00d2b3c225f0b3f5c751.png            }5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngvoidfileExit_ActionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png        System.exit(0);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }f466905a3bcb5dcef110eab799825254.png}731655954c7be9d8835ece551b5385f8.png

    9310e85a14af99de4811ff4c77f1f911.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png//teacherInformation.java731655954c7be9d8835ece551b5385f8.pngpackageXSCJ;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Dimension;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Rectangle;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionEvent;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionListener;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Connection;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Date;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.DriverManager;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.ResultSet;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.SQLException;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Statement;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JFrame;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenu;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenuBar;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenuItem;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JTable;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.table.DefaultTableModel;

    731655954c7be9d8835ece551b5385f8.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png

    9310e85a14af99de4811ff4c77f1f911.pngpublicclassteacherInformationextendsJFrame222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png    String[] column=222530190136c9c4cfd237cc0d5cff99.png{"教师号","教师姓名","性别","出生日期","职称","院系"};

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenuBar menuBar=newJMenuBar();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenu menuFile=newJMenu();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenuItem menuFileExit=newJMenuItem();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJTable teacherTable=newJTable();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png    DefaultTableModel mm=newDefaultTableModel(column,0)222530190136c9c4cfd237cc0d5cff99.png{

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    };

    1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicteacherInformation()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            jbInit();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidjbInit()throwsException222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngthis.setJMenuBar(menuBar);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().setLayout(null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.setSize(newDimension(534,435));

    1408c5260b2f05e450dee929db9be5f7.pngthis.setTitle("教师信息");

    1408c5260b2f05e450dee929db9be5f7.png        menuFile.setText("File");

    1408c5260b2f05e450dee929db9be5f7.png        menuFileExit.setText("Exit");

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        menuFileExit.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent ae)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    fileExit_ActionPerformed(ae);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        teacherTable.setBounds(newRectangle(20,25,490,290));

    1408c5260b2f05e450dee929db9be5f7.png        menuFile.add(menuFileExit);

    1408c5260b2f05e450dee929db9be5f7.png        menuBar.add(menuFile);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(teacherTable,null);

    1408c5260b2f05e450dee929db9be5f7.pngintteacherNumber;

    1408c5260b2f05e450dee929db9be5f7.png        String teacherName, teacherSex, teacherProf, teacherDepart;

    1408c5260b2f05e450dee929db9be5f7.png        Date teacherBirthday;

    1408c5260b2f05e450dee929db9be5f7.png        Connection conn=null;

    1408c5260b2f05e450dee929db9be5f7.png        Statement state=null;

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            Class.forName("oracle.jdbc.OracleDriver").newInstance();

    1408c5260b2f05e450dee929db9be5f7.png            conn=1408c5260b2f05e450dee929db9be5f7.pngDriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XSCJ","system",

    1408c5260b2f05e450dee929db9be5f7.png"qazwsx");

    1408c5260b2f05e450dee929db9be5f7.png            state=conn.createStatement();

    1408c5260b2f05e450dee929db9be5f7.png            ResultSet rs=state.executeQuery("select * from teacher");

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngwhile(rs.next())222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                teacherNumber=rs.getInt("tno");

    1408c5260b2f05e450dee929db9be5f7.png                teacherName=rs.getString("name");

    1408c5260b2f05e450dee929db9be5f7.png                teacherSex=rs.getString("sex");

    1408c5260b2f05e450dee929db9be5f7.png                teacherBirthday=rs.getDate("birthday");

    1408c5260b2f05e450dee929db9be5f7.png                teacherProf=rs.getString("prof");

    1408c5260b2f05e450dee929db9be5f7.png                teacherDepart=rs.getString("depart");

    1408c5260b2f05e450dee929db9be5f7.png                Object[] teacherInfo=715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png222530190136c9c4cfd237cc0d5cff99.png{ teacherNumber, teacherName, teacherSex, teacherBirthday,

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                  teacherProf, teacherDepart };

    1408c5260b2f05e450dee929db9be5f7.png                mm.addRow(teacherInfo);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png            }1408c5260b2f05e450dee929db9be5f7.png            teacherTable.setModel(mm);

    1408c5260b2f05e450dee929db9be5f7.png            rs.close();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(SQLException e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            System.out.println("Error Code="+e.getErrorCode());

    1408c5260b2f05e450dee929db9be5f7.png            System.out.println("Error Message="+e.getMessage());

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }finally222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(state!=null)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    state.close();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(conn!=null)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    conn.close();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png            }catch(SQLException e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                System.out.println("Error Code="+e.getErrorCode());

    1408c5260b2f05e450dee929db9be5f7.png                System.out.println("Error Message="+e.getMessage());

    5bcb1807ee3e00d2b3c225f0b3f5c751.png            }5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngvoidfileExit_ActionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png        System.exit(0);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }f466905a3bcb5dcef110eab799825254.png}

    9310e85a14af99de4811ff4c77f1f911.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png//courseInformation.java731655954c7be9d8835ece551b5385f8.pngpackageXSCJ;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Dimension;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Rectangle;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionEvent;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionListener;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Connection;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Date;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.DriverManager;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.ResultSet;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.SQLException;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Statement;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JFrame;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenu;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenuBar;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenuItem;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JTable;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.table.DefaultTableModel;

    731655954c7be9d8835ece551b5385f8.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png

    9310e85a14af99de4811ff4c77f1f911.pngpublicclasscourseInformationextendsJFrame222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png    String[] column=222530190136c9c4cfd237cc0d5cff99.png{"课程号","课程名称","学生姓名"};

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenuBar menuBar=newJMenuBar();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenu menuFile=newJMenu();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenuItem menuFileExit=newJMenuItem();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJTable courseTable=newJTable();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png    DefaultTableModel mm=newDefaultTableModel(column,0)222530190136c9c4cfd237cc0d5cff99.png{

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    };

    1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpubliccourseInformation()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            jbInit();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidjbInit()throwsException222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngthis.setJMenuBar(menuBar);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().setLayout(null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.setSize(newDimension(489,383));

    1408c5260b2f05e450dee929db9be5f7.pngthis.setTitle("课程信息");

    1408c5260b2f05e450dee929db9be5f7.png        menuFile.setText("File");

    1408c5260b2f05e450dee929db9be5f7.png        menuFileExit.setText("Exit");

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        menuFileExit.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent ae)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    fileExit_ActionPerformed(ae);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        courseTable.setBounds(newRectangle(17,35,450,260));

    1408c5260b2f05e450dee929db9be5f7.png        menuFile.add(menuFileExit);

    1408c5260b2f05e450dee929db9be5f7.png        menuBar.add(menuFile);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(courseTable,null);

    1408c5260b2f05e450dee929db9be5f7.png        String courseNumber, courseName, teacherName;

    1408c5260b2f05e450dee929db9be5f7.png

    1408c5260b2f05e450dee929db9be5f7.png        Connection conn=null;

    1408c5260b2f05e450dee929db9be5f7.png        Statement state=null;

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            Class.forName("oracle.jdbc.OracleDriver").newInstance();

    1408c5260b2f05e450dee929db9be5f7.png            conn=1408c5260b2f05e450dee929db9be5f7.pngDriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XSCJ","system",

    1408c5260b2f05e450dee929db9be5f7.png"qazwsx");

    1408c5260b2f05e450dee929db9be5f7.png            state=conn.createStatement();

    1408c5260b2f05e450dee929db9be5f7.png            ResultSet rs=1408c5260b2f05e450dee929db9be5f7.png                state.executeQuery("select cno,cname,teacher.name from course,teacher where course.tno=teacher.tno");

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngwhile(rs.next())222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                courseNumber=rs.getString("cno");

    1408c5260b2f05e450dee929db9be5f7.png                courseName=rs.getString("cname");

    1408c5260b2f05e450dee929db9be5f7.png                teacherName=rs.getString("name");

    1408c5260b2f05e450dee929db9be5f7.png                Object[] courseInfo=715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png222530190136c9c4cfd237cc0d5cff99.png{ courseNumber, courseName, teacherName };

    1408c5260b2f05e450dee929db9be5f7.png                mm.addRow(courseInfo);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png            }1408c5260b2f05e450dee929db9be5f7.png            courseTable.setModel(mm);

    1408c5260b2f05e450dee929db9be5f7.png            rs.close();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(SQLException e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            System.out.println("Error Code="+e.getErrorCode());

    1408c5260b2f05e450dee929db9be5f7.png            System.out.println("Error Message="+e.getMessage());

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }finally222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(state!=null)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    state.close();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(conn!=null)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    conn.close();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png            }catch(SQLException e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                System.out.println("Error Code="+e.getErrorCode());

    1408c5260b2f05e450dee929db9be5f7.png                System.out.println("Error Message="+e.getMessage());

    5bcb1807ee3e00d2b3c225f0b3f5c751.png            }5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngvoidfileExit_ActionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png        System.exit(0);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }f466905a3bcb5dcef110eab799825254.png}731655954c7be9d8835ece551b5385f8.png

    9310e85a14af99de4811ff4c77f1f911.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png//scoreInformation.java731655954c7be9d8835ece551b5385f8.pngpackageXSCJ;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Dimension;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.Rectangle;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionEvent;

    731655954c7be9d8835ece551b5385f8.pngimportjava.awt.event.ActionListener;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Connection;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.DriverManager;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.ResultSet;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.SQLException;

    731655954c7be9d8835ece551b5385f8.pngimportjava.sql.Statement;

    731655954c7be9d8835ece551b5385f8.png

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JFrame;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenu;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenuBar;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JMenuItem;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JScrollPane;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.JTable;

    731655954c7be9d8835ece551b5385f8.pngimportjavax.swing.table.DefaultTableModel;

    731655954c7be9d8835ece551b5385f8.png

    24a924a57ba6b3f2b51fc9edb7ea4186.png

    9310e85a14af99de4811ff4c77f1f911.pngpublicclassscoreInformationextendsJFrame222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png    String[] column=222530190136c9c4cfd237cc0d5cff99.png{"学号","课程号","分数"};

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenuBar menuBar=newJMenuBar();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenu menuFile=newJMenu();

    1408c5260b2f05e450dee929db9be5f7.pngprivateJMenuItem menuFileExit=newJMenuItem();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png    DefaultTableModel mm=newDefaultTableModel(column,0)222530190136c9c4cfd237cc0d5cff99.png{

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    };

    1408c5260b2f05e450dee929db9be5f7.pngprivateJTable scoreTable=newJTable();

    1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicscoreInformation()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            jbInit();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngprivatevoidjbInit()throwsException222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.pngthis.setJMenuBar(menuBar);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().setLayout(null);

    1408c5260b2f05e450dee929db9be5f7.pngthis.setSize(newDimension(501,437));

    1408c5260b2f05e450dee929db9be5f7.pngthis.setTitle("成绩信息");

    1408c5260b2f05e450dee929db9be5f7.png        menuFile.setText("File");

    1408c5260b2f05e450dee929db9be5f7.png        menuFileExit.setText("Exit");

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        menuFileExit.addActionListener(newActionListener()222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngpublicvoidactionPerformed(ActionEvent ae)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    fileExit_ActionPerformed(ae);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }5bcb1807ee3e00d2b3c225f0b3f5c751.png            });

    1408c5260b2f05e450dee929db9be5f7.png        scoreTable.setBounds(newRectangle(25,15,445,345));

    1408c5260b2f05e450dee929db9be5f7.png        menuFile.add(menuFileExit);

    1408c5260b2f05e450dee929db9be5f7.png        menuBar.add(menuFile);

    1408c5260b2f05e450dee929db9be5f7.pngthis.getContentPane().add(scoreTable,null);

    1408c5260b2f05e450dee929db9be5f7.pngintdegree;

    1408c5260b2f05e450dee929db9be5f7.png        String courseName, studentName;

    1408c5260b2f05e450dee929db9be5f7.png

    1408c5260b2f05e450dee929db9be5f7.png        Connection conn=null;

    1408c5260b2f05e450dee929db9be5f7.png        Statement state=null;

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            Class.forName("oracle.jdbc.OracleDriver").newInstance();

    1408c5260b2f05e450dee929db9be5f7.png            conn=1408c5260b2f05e450dee929db9be5f7.pngDriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XSCJ","system",

    1408c5260b2f05e450dee929db9be5f7.png"qazwsx");

    1408c5260b2f05e450dee929db9be5f7.png            state=conn.createStatement();

    1408c5260b2f05e450dee929db9be5f7.png            ResultSet rs=1408c5260b2f05e450dee929db9be5f7.png                state.executeQuery("select student.name,course.cname,score.degree from student,course,score where score.sno=student.sno and score.cno=course.cno");

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngwhile(rs.next())222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                studentName=rs.getString("name");

    1408c5260b2f05e450dee929db9be5f7.png                courseName=rs.getString("cname");

    1408c5260b2f05e450dee929db9be5f7.png                degree=rs.getInt("degree");

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png                Object[] scoreInfo=222530190136c9c4cfd237cc0d5cff99.png{ studentName, courseName, degree };

    1408c5260b2f05e450dee929db9be5f7.png                mm.addRow(scoreInfo);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png            }1408c5260b2f05e450dee929db9be5f7.png            scoreTable.setModel(mm);

    1408c5260b2f05e450dee929db9be5f7.png            rs.close();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(SQLException e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            System.out.println("Error Code="+e.getErrorCode());

    1408c5260b2f05e450dee929db9be5f7.png            System.out.println("Error Message="+e.getMessage());

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }catch(Exception e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png            e.printStackTrace();

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png        }finally222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngtry222530190136c9c4cfd237cc0d5cff99.png{

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(state!=null)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    state.close();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngif(conn!=null)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                    conn.close();

    5bcb1807ee3e00d2b3c225f0b3f5c751.png                }715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.png            }catch(SQLException e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png                System.out.println("Error Code="+e.getErrorCode());

    1408c5260b2f05e450dee929db9be5f7.png                System.out.println("Error Message="+e.getMessage());

    5bcb1807ee3e00d2b3c225f0b3f5c751.png            }5bcb1807ee3e00d2b3c225f0b3f5c751.png        }5bcb1807ee3e00d2b3c225f0b3f5c751.png    }1408c5260b2f05e450dee929db9be5f7.png

    715f2d05503b99d41f3b6ba2cdccc84d.png

    e083dfde5a91f50979fe8979b4012b9d.pngvoidfileExit_ActionPerformed(ActionEvent e)222530190136c9c4cfd237cc0d5cff99.png{

    1408c5260b2f05e450dee929db9be5f7.png        System.exit(0);

    5bcb1807ee3e00d2b3c225f0b3f5c751.png    }f466905a3bcb5dcef110eab799825254.png}

    还有大概45页的代码,太难复制粘贴了,而且浏览器已经很卡了,其实其他的代码和上面已经贴出来的差不多,我想的话根据上面的代码在去做其他的功能叶不需要多长时间,所以就不再贴代码了,昨天找了下当时的工程,发现已经找不到了,只剩下文档了。

    展开全文
  • SQL Server数据库: Course表: (1)设计 (2)数据 属性依次为:课程号、课程名、先修课课程号、学分 主键为课程号 Student表: (1)设计 (2)数据 属性依次为:学号、姓名、性别、年龄、所在系系名 主键为...

    SQL Server数据库设计

    Course表:
    (1)设计
    在这里插入图片描述
    (2)数据
    在这里插入图片描述
    属性依次为:课程号、课程名、先修课课程号、学分
    主键为课程号

    Student表:
    (1)设计
    在这里插入图片描述
    (2)数据
    在这里插入图片描述
    属性依次为:学号、姓名、性别、年龄、所在系系名
    主键为学号

    SC表:表示学生选课关系
    (1)设计
    在这里插入图片描述
    (2)数据
    在这里插入图片描述
    属性依次为学号、课程号、分数
    主键为学号、课程号

    触发器:
    1)在Student表上定义一个DELETE触发器,当删除一个学生记录时,自动删除SC表上这个学生的所有选课记录 。
    2)在Course表上定义一个UPDA TE触发器,当更新一门课程的课程号时,自动修改SC表上这门课程的课程号 。
    3) 在SC表上定义一个DELETE触发器,当删除一条选课记录时,若这条记录是这门课程的唯一被选记录,则同时删除Course表中的这门课程 。

    数据库与java结合形成图形化界面。
    以下为java程序:

    完成数据库中数据的增删改查(Add、Del、Update、Sel)
    我的数据库中只有三个表,所以完成这些功能需要12个类:

    AddC

    /*
    AddC
    */
    package sc;
    import java.awt.*;
    import javax.swing.*;
    import java.sql.*;
    import java.awt.event.*;
    
    public class AddC extends JPanel implements ActionListener{
    	JTextField 课程号,课程名,先修课课程号,学分;
    	JButton 录入;
    	
    public AddC(){
    	try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
    	catch(Exception e){System.err.println("不能设置外观:   "+e);}
    	
    	课程号=new JTextField(12);
    	课程名=new JTextField(12);
    	先修课课程号=new JTextField(12);
    	学分=new JTextField(12);
    	录入=new JButton("录入");
    	录入.addActionListener(this);
    	
    	Box box1=Box.createHorizontalBox();//横放box
    	Box box2=Box.createHorizontalBox();
    	Box box3=Box.createHorizontalBox();
    	Box box4=Box.createHorizontalBox();
    	Box box5=Box.createHorizontalBox();
    	Box box6=Box.createHorizontalBox();
    	box1.add(new JLabel("课程号:"));
    	box1.add(课程号);
    	box2.add(new JLabel("课程名:"));
    	box2.add(课程名);
    	box3.add(new JLabel("先修课课程号:"));
    	box3.add(先修课课程号);
    	box4.add(new JLabel("学分:"));
    	box4.add(学分);
    	box6.add(录入);
    	Box boxH=Box.createVerticalBox();//竖放box
    	boxH.add(box1);
    	boxH.add(box2);
    	boxH.add(box3);
    	boxH.add(box4);
    	boxH.add(box5);
    	boxH.add(box6);
    	boxH.add(Box.createVerticalGlue());
    	JPanel messPanel=new JPanel();
    	messPanel.add(boxH);
    	setLayout(new BorderLayout());
    	add(messPanel,BorderLayout.CENTER);
    	validate();
    }
    public void actionPerformed(ActionEvent c){
    	Object obj=c.getSource();
    	if(obj==录入){
    		if(课程号.getText().equals("")||课程名.getText().equals("")||先修课课程号.getText().equals("")||学分.getText().equals("")){
    			JOptionPane.showMessageDialog(this,"学生信息请填满再录入!" );
    		}
    		Statement stmt=null;
    		ResultSet rs=null,rs1=null;
    		String sql,sql1;
    		    sql1="select * from Course where Cno='"+课程号.getText()+"'";
    		    sql="insert into Course values('"+课程号.getText()+"','"+课程名.getText()+"','"+先修课课程号.getText()+"','"+学分.getText()+"')";
    	   try{
    		   Connection dbConn1=CONN();
    			stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    			rs1=stmt.executeQuery(sql1);
    			if(rs1.next()){JOptionPane.showMessageDialog(this,"该课号以存在,无法添加");}
    			else{
    			stmt.executeUpdate(sql);	
    			JOptionPane.showMessageDialog(this,"添加成功");
    			}		
    			rs1.close();
    			
    			stmt.close();
    	   }
    	   catch(SQLException e){
    		   System.out.print("SQL Exception occur.Message is:"+e.getMessage());
    		   }
    	}
    }
    public static Connection CONN(){
    	   String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";   //加载JDBC驱动
    	   String dbURL = "jdbc:sqlserver://主机名:1433; DatabaseName=数据库名";   //连接服务器和数据库test
    	   String userName = "sa";   //默认用户名
    	   String userPwd = "密码";   //密码
    	   Connection dbConn=null;
    
    	   try {
    	   Class.forName(driverName);
    	   dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
    	   System.out.println("Connection Successful!");   //如果连接成功 控制台输出Connection Successful!
    	   } catch (Exception e) {
    	   e.printStackTrace();
    	   }
    	   return dbConn;
    }
    
    }
    
    

    AddS

    /*
    AddS
    */
    package sc;
    import java.awt.*;
    import javax.swing.*;
    import java.sql.*;
    import java.awt.event.*;
    
    
    public  class AddS extends JPanel implements ActionListener{
    	JTextField 学号,姓名,性别,年龄,所在系系名;
    	JButton 录入;
    	
    public AddS(){
    	try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
    	catch(Exception e){System.err.println("不能设置外观:   "+e);}
    	
    	学号=new JTextField(12);
    	姓名=new JTextField(12);
    	性别=new JTextField(12);
    	年龄=new JTextField(12);
    	所在系系名=new JTextField(12);
    	录入=new JButton("录入");
    	录入.addActionListener(this);
    	
    	Box box1=Box.createHorizontalBox();//横放box
    	Box box2=Box.createHorizontalBox();
    	Box box3=Box.createHorizontalBox();
    	Box box4=Box.createHorizontalBox();
    	Box box5=Box.createHorizontalBox();
    	Box box6=Box.createHorizontalBox();
    	box1.add(new JLabel("学号:"/*,JLabel.CENTER*/));
    	box1.add(学号);
    	box2.add(new JLabel("姓名:"/*,JLabel.CENTER*/));
    	box2.add(姓名);
    	box3.add(new JLabel("性别:"/*,JLabel.CENTER*/));
    	box3.add(性别);
    	box4.add(new JLabel("年龄:"/*,JLabel.CENTER*/));
    	box4.add(年龄);
    	box5.add(new JLabel("所在系系名:"/*,JLabel.CENTER*/));
    	box5.add(所在系系名);
    	box6.add(录入);
    	Box boxH=Box.createVerticalBox();//竖放box
    	boxH.add(box1);
    	boxH.add(box2);
    	boxH.add(box3);
    	boxH.add(box4);
    	boxH.add(box5);
    	boxH.add(box6);
    	boxH.add(Box.createVerticalGlue());
    	JPanel messPanel=new JPanel();
    	messPanel.add(boxH);
    	setLayout(new BorderLayout());
    	add(messPanel,BorderLayout.CENTER);
    	validate();
    	}
    public void actionPerformed(ActionEvent c){
    	Object obj=c.getSource();
    	if(obj==录入){
    		if(学号.getText().equals("")||姓名.getText().equals("")||性别.getText().equals("")||年龄.getText().equals("")||所在系系名.getText().equals("")){
    			JOptionPane.showMessageDialog(this,"学生信息请填满再录入!" );
    		}
    		Statement stmt=null;
    		ResultSet rs1=null;
    		String sql,sql1;
    		    sql1="select * from Student where Sno='"+学号.getText()+"'";
    		    sql="insert into Student values('"+学号.getText()+"','"+姓名.getText()+"','"+性别.getText()+"','"+年龄.getText()+"','"+所在系系名.getText()+"')";
    	   try{
    		   Connection dbConn1=CONN();
    			stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    			rs1=stmt.executeQuery(sql1);
    			if(rs1.next()){JOptionPane.showMessageDialog(this,"该学号已经存在,无法添加");}
    			else{
    			stmt.executeUpdate(sql);	
    			JOptionPane.showMessageDialog(this,"添加成功");
    			}		
    			rs1.close();
    			stmt.close();
    	   }
    	   catch(SQLException e){
    		   System.out.print("SQL Exception occur.Message is:"+e.getMessage());
    		   }
    	}
    }
    public static Connection CONN(){
    	   String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";   //加载JDBC驱动
    	    String dbURL = "jdbc:sqlserver://主机名:1433; DatabaseName=数据库名";   //连接服务器和数据库test
    	   String userName = "sa";   //默认用户名
    	   String userPwd = "密码";   //密码
    	   Connection dbConn=null;
    
    	   try {
    	   Class.forName(driverName);
    	   dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
    	   System.out.println("Connection Successful!");   //如果连接成功 控制台输出Connection Successful!
    	   } catch (Exception e) {
    	   e.printStackTrace();
    	   }
    	   return dbConn;
    }
    
    }
    
    
    
    

    AddSC

    /*
    AddSC
    */
    package sc;
    
    import java.awt.*;
    
    import javax.swing.*;
    
    import java.sql.*;
    import java.util.*;
    import javax.swing.filechooser.*;
    import java.io.*;
    import java.awt.event.*;
    
    public class AddSC extends JPanel implements ActionListener{
    	JTextField 课程号,学号,成绩;
    	JButton 录入;
    	
    public AddSC(){
    	try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
    	catch(Exception e){System.err.println("不能设置外观:   "+e);}
    	
    	课程号=new JTextField(12);
    	学号=new JTextField(12);
    	成绩=new JTextField(12);
    	录入=new JButton("录入");
    	录入.addActionListener(this);
    	
    	Box box1=Box.createHorizontalBox();//横放box
    	Box box2=Box.createHorizontalBox();
    	Box box3=Box.createHorizontalBox();
    	Box box4=Box.createHorizontalBox();
    	box1.add(new JLabel("课号:"));
    	box1.add(课程号);
    	box2.add(new JLabel("学号:"));
    	box2.add(学号);
    	box3.add(new JLabel("成绩:"));
    	box3.add(成绩);
    	box4.add(录入);
    	Box boxH=Box.createVerticalBox();//竖放box
    	boxH.add(box1);
    	boxH.add(box2);
    	boxH.add(box3);
    	boxH.add(box4);
    	boxH.add(Box.createVerticalGlue());
    	JPanel messPanel=new JPanel();
    	messPanel.add(boxH);
    	setLayout(new BorderLayout());
    	add(messPanel,BorderLayout.CENTER);
    	validate();
    }
    public void actionPerformed(ActionEvent c){
    	Object obj=c.getSource();
    	if(obj==录入){
    		if(课程号.getText().equals("")||学号.getText().equals("")){
    			JOptionPane.showMessageDialog(this,"填写课号与学号才能录入!" );
    		}
    		else
    		{
    		Statement stmt=null;
    		ResultSet rs=null,rs1=null,rsC=null,rsS=null;
    		String sql,sql1,sqlS,sqlC;
    		    sqlC="select * from Course where Cno='"+课程号.getText()+"'";
    		    sqlS="select * from Student where Sno='"+学号.getText()+"'";
    		    sql1="select * from SC where Cno='"+课程号.getText()+"' and Sno='"+学号.getText()+"'";
    		    sql="insert into SC values('"+学号.getText()+"','"+课程号.getText()+"','"+成绩.getText()+"')";
    	   try{
    		   Connection dbConn1=CONN();
    			stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    			rsC=stmt.executeQuery(sqlC);
    			if(rsC.next()){
    				rsS=stmt.executeQuery(sqlS);
    				if(rsS.next()){
    			rs1=stmt.executeQuery(sql1);
    			if(rs1.next()){JOptionPane.showMessageDialog(this,"该学生以选该课程号,无法添加");}
    			else{
    			stmt.executeUpdate(sql);	
    			JOptionPane.showMessageDialog(this,"添加成功");
    			}
    			rs1.close();
    			}
    				else{JOptionPane.showMessageDialog(this,"该学生不存在,无法添加");}
    				rsS.close();
    			}
    			else{JOptionPane.showMessageDialog(this,"该课程不存在,无法添加");}
    			rsC.close();
    			stmt.close();
    	   }
    	   catch(SQLException e){
    		   System.out.print("SQL Exception occur.Message is:"+e.getMessage());
    		   }
    	   }
    	}
    }
    	public static Connection CONN(){
    		   String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";   //加载JDBC驱动
    		    String dbURL = "jdbc:sqlserver://主机名:1433; DatabaseName=数据库名";   //连接服务器和数据库test
    	   String userName = "sa";   //默认用户名
    	   String userPwd = "密码";   //密码
    		   Connection dbConn=null;
    
    		   try {
    		   Class.forName(driverName);
    		   dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
    		   System.out.println("Connection Successful!");   //如果连接成功 控制台输出Connection Successful!
    		   } catch (Exception e) {
    		   e.printStackTrace();
    		   }
    		   return dbConn;
    	}
    
    }
    
    

    DelC

    /*
    DelC
    */
    package sc;
    
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import javax.swing.*;
    public class DelC extends JPanel implements ActionListener{
    	String save=null;
    	JTextField 课号1,课程号,课程名,先修课课程号,学分;
    	JButton 删除,查找;
    	
    public DelC(){
    	try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
    	catch(Exception e){System.err.println("不能设置外观:   "+e);}
    	
    	课号1=new JTextField(12);
    	课程号=new JTextField(12);
    	课程名=new JTextField(12);
    	先修课课程号=new JTextField(12);
    	学分=new JTextField(12);
    	删除=new JButton("删除");
    	查找=new JButton("查找");
    	
    	Box box1=Box.createHorizontalBox();//横放box
    	Box box2=Box.createHorizontalBox();
    	Box box3=Box.createHorizontalBox();
    	Box box4=Box.createHorizontalBox();
    	Box box5=Box.createHorizontalBox();
    	Box box6=Box.createHorizontalBox();
    	Box box7=Box.createHorizontalBox();
    	box1.add(new JLabel("课程号:",JLabel.CENTER));
    	box1.add(课程号);
    	box2.add(new JLabel("课程名:",JLabel.CENTER));
    	box2.add(课程名);
    	box3.add(new JLabel("先修课课程号:",JLabel.CENTER));
    	box3.add(先修课课程号);
    	box4.add(new JLabel("学分:",JLabel.CENTER));
    	box4.add(学分);
    	box6.add(删除);
    	box7.add(new JLabel("课号:",JLabel.CENTER));
    	box7.add(课号1);
    	box7.add(查找);
    	Box boxH=Box.createVerticalBox();//竖放box
    	boxH.add(box1);
    	boxH.add(box2);
    	boxH.add(box3);
    	boxH.add(box4);
    	boxH.add(box5);
    	boxH.add(box6);
    	//boxH.add(box7);
    	boxH.add(Box.createVerticalGlue());
    	
    	删除.addActionListener(this);
        查找.addActionListener(this);
    	
    	JPanel picPanel=new JPanel();
    	JPanel messPanel=new JPanel();
    	messPanel.add(box7);
    	picPanel.add(boxH);
    	setLayout(new BorderLayout());
    	JSplitPane splitV=new JSplitPane(JSplitPane.VERTICAL_SPLIT,messPanel,picPanel);//分割
    	add(splitV,BorderLayout.CENTER);
    	validate();
    
    }
    public void actionPerformed(ActionEvent e){
    	Object obj=e.getSource();
    	Statement stmt=null;
    	ResultSet rs=null,rs1=null;
        String sql=null,sql1=null,sqlSC=null;
    	if(obj==查找){if(课号1.getText().equals(""))JOptionPane.showMessageDialog(this,"请填写查询的课号!" );
    	else{
    	    sql1="select * from Course where Cno='"+课号1.getText()+"'";
    	    try{
    	    Connection dbConn1=CONN();
    		stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    		rs1=stmt.executeQuery(sql1);
    	    if(rs1.next()){课程号.setText(rs1.getString("Cno").trim());
    	                   课程名.setText(rs1.getString("Cname").trim());
    	                   先修课课程号.setText(rs1.getString("Cpno").trim());
    	                   学分.setText(rs1.getString("Ccredit").trim());
    	                   save=课号1.getText().trim();	    	
    	    }
    	    else{JOptionPane.showMessageDialog(this,"没有这个课号的课程" );}
    	    stmt.close();
    	    rs1.close();
    	    }catch(SQLException e1){
    			   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    		   }
    	    }
    	}
    	else{
    		if(obj==删除){if(save==null)JOptionPane.showMessageDialog(this,"还没查找需要修改的课程" );
    		else{sql="delete from Course where Cno='"+save+"'";
    		sqlSC="delete from SC where Cno='"+save+"'";
    		try{
    		    Connection dbConn1=CONN();
    			stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    			stmt.executeUpdate(sql);
    			stmt.executeUpdate(sqlSC);
    			save=null;
    			JOptionPane.showMessageDialog(this,"删除完成" );
    			课程号.setText("");
                课程名.setText("");
                先修课课程号.setText("");
                学分.setText("");
    			stmt.close();
    		    }catch(SQLException e1){
    				   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    			   }
    		}
    		}
    }
    }
    
    //	连接数据库方法
    public static Connection CONN(){
    	   String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";   //加载JDBC驱动
    	    String dbURL = "jdbc:sqlserver://主机名:1433; DatabaseName=数据库名";   //连接服务器和数据库test
    	   String userName = "sa";   //默认用户名
    	   String userPwd = "密码";   //密码
    	   Connection dbConn=null;
    
    	   try {
    	   Class.forName(driverName);
    	   dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
    	   System.out.println("Connection Successful!");   //如果连接成功 控制台输出Connection Successful!
    	   } catch (Exception e) {
    	   e.printStackTrace();
    	   }
    	   return dbConn;
    }
    
    }
    
    

    DelS

    /*
    DelS
    */
    package sc;
    
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import javax.swing.*;
    
    
    public class DelS extends JPanel implements ActionListener{
    String save=null;
    JTextField 学号1,学号,姓名,性别,年龄,所在系系名;
    JButton 删除,查找;
    	
    public DelS(){
    	try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
    	catch(Exception e){System.err.println("不能设置外观:   "+e);}
    		
    	学号1=new JTextField(12);
    	学号=new JTextField(12);
    	姓名=new JTextField(12);
    	性别=new JTextField(12);
    	年龄=new JTextField(12);
    	所在系系名=new JTextField(12);
    	删除=new JButton("删除");
    	查找=new JButton("查找");
    	
    	Box box1=Box.createHorizontalBox();//横放box
    	Box box2=Box.createHorizontalBox();
    	Box box3=Box.createHorizontalBox();
    	Box box4=Box.createHorizontalBox();
    	Box box5=Box.createHorizontalBox();
    	Box box6=Box.createHorizontalBox();
    	Box box7=Box.createHorizontalBox();
    	
    	box1.add(new JLabel("学号:",JLabel.CENTER));
    	box1.add(学号);
    	box2.add(new JLabel("姓名:",JLabel.CENTER));
    	box2.add(姓名);
    	box3.add(new JLabel("性别:",JLabel.CENTER));
    	box3.add(性别);
    	box4.add(new JLabel("年龄:",JLabel.CENTER));
    	box4.add(年龄);
    	box5.add(new JLabel("所在系系名:",JLabel.CENTER));
    	box5.add(所在系系名);
    	box6.add(删除);
    	box7.add(new JLabel("学号:",JLabel.CENTER));
    	box7.add(学号1);
    	box7.add(查找);
    	Box boxH=Box.createVerticalBox();//竖放box
    	boxH.add(box1);
    	boxH.add(box2);
    	boxH.add(box3);
    	boxH.add(box4);
    	boxH.add(box5);
    	boxH.add(box6);
    	
    	boxH.add(Box.createVerticalGlue());
    	
    	删除.addActionListener(this);
    	    查找.addActionListener(this);
    	
    	JPanel picPanel=new JPanel();
    	JPanel messPanel=new JPanel();
    	messPanel.add(box7);
    	picPanel.add(boxH);
    	setLayout(new BorderLayout());
    	JSplitPane splitV=new JSplitPane(JSplitPane.VERTICAL_SPLIT,messPanel,picPanel);//分割
    	add(splitV,BorderLayout.CENTER);
    	validate();
    }
    public void actionPerformed(ActionEvent e){
    	Object obj=e.getSource();
    	Statement stmt=null;
    	ResultSet rs=null,rs1=null;
    	    String sql=null,sql1=null,sqlSC=null;
    	
    	if(obj==查找){if(学号1.getText().equals(""))JOptionPane.showMessageDialog(this,"请填写查询的学号!" );
    	else{
    	    sql1="select * from Student where Sno='"+学号1.getText()+"'";
    	    try{
    	    Connection dbConn1=CONN();
    	    stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    	    rs1=stmt.executeQuery(sql1);
    	    if(rs1.next()){学号.setText(rs1.getString("Sno").trim());
    	                   姓名.setText(rs1.getString("Sname").trim());
    	                   性别.setText(rs1.getString("Ssex").trim());
    	                		  年龄.setText(rs1.getString("Sage").trim());
    	                				   所在系系名.setText(rs1.getString("Sdept").trim());
    	                   save=学号1.getText().trim();    
    	    }
    	    else{JOptionPane.showMessageDialog(this,"没有这个学号的学生" );}
    	    stmt.close();
    	    rs1.close();
    	    }catch(SQLException e1){
    	   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    	   }
    	    }
    	}
    	else{
    	if(obj==删除){if(save==null)JOptionPane.showMessageDialog(this,"还没查找需要修改的学生" );
    	else{sql="delete from Student where Sno='"+save+"'";
    	     sqlSC="delete from SC where Sno='"+save+"'";
    	try{
    	    Connection dbConn1=CONN();
    	stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    	stmt.executeUpdate(sql);
    	stmt.executeUpdate(sqlSC);
    	save=null;
    	JOptionPane.showMessageDialog(this,"删除完成" );
    	学号.setText("");
    	            姓名.setText("");
    	            性别.setText("");
    	            年龄.setText("");
    	            所在系系名.setText("");
    	
    	stmt.close();
    	    }catch(SQLException e1){
    	   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    	   }
    	}
    	}
    	}
    }
    public static Connection CONN(){
    	   String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";   //加载JDBC驱动
    	    String dbURL = "jdbc:sqlserver://主机名:1433; DatabaseName=数据库名";   //连接服务器和数据库test
    	   String userName = "sa";   //默认用户名
    	   String userPwd = "密码";   //密码
    	   Connection dbConn=null;
    
    	   try {
    	   Class.forName(driverName);
    	   dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
    	   System.out.println("Connection Successful!");   //如果连接成功 控制台输出Connection Successful!
    	   } catch (Exception e) {
    	   e.printStackTrace();
    	   }
    	   return dbConn;
    }
    
    }
    
    

    DelSC

    /*
    DelSC
    */
    package sc;
    
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import javax.swing.*;
    
    public class DelSC extends JPanel implements ActionListener{
    	String saveC=null;
    	String saveS=null;
    	JTextField 课号1,学号1,学号,课程号,成绩;
    	JButton 删除,查找;
    	
    public DelSC(){
    	try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
    	catch(Exception e){System.err.println("不能设置外观:   "+e);}
    	
    	学号1=new JTextField(12);
    	课号1=new JTextField(12);
    	课程号=new JTextField(12);
    	学号=new JTextField(12);
    	成绩=new JTextField(12);
    	删除=new JButton("删除");
    	查找=new JButton("查找");
    	
    	Box box1=Box.createHorizontalBox();//横放box
    	Box box2=Box.createHorizontalBox();
    	Box box3=Box.createHorizontalBox();
    	Box box4=Box.createHorizontalBox();
    	Box box5=Box.createHorizontalBox();
    	box1.add(new JLabel("课程号:",JLabel.CENTER));
    	box1.add(课程号);
    	box2.add(new JLabel("学号:",JLabel.CENTER));
    	box2.add(学号);
    	box3.add(new JLabel("成绩:",JLabel.CENTER));
    	box3.add(成绩);
    	box4.add(删除);
    	box5.add(new JLabel("课号:",JLabel.CENTER));
    	box5.add(课号1);
    	box5.add(new JLabel("学号:",JLabel.CENTER));
    	box5.add(学号1);
    	box5.add(查找);
    	Box boxH=Box.createVerticalBox();//竖放box
    	boxH.add(box1);
    	boxH.add(box2);
    	boxH.add(box3);
    	boxH.add(box4);
    	boxH.add(Box.createVerticalGlue());
    	
    	删除.addActionListener(this);
        查找.addActionListener(this);
    	
    	JPanel picPanel=new JPanel();
    	JPanel messPanel=new JPanel();
    	messPanel.add(box5);
    	picPanel.add(boxH);
    	setLayout(new BorderLayout());
    	JSplitPane splitV=new JSplitPane(JSplitPane.VERTICAL_SPLIT,messPanel,picPanel);//分割
    	add(splitV,BorderLayout.CENTER);
    	validate();
    
    }
    public void actionPerformed(ActionEvent e){
    	Object obj=e.getSource();
    	Statement stmt=null;
    	ResultSet rs=null,rs1=null;
        String sql=null,sql1=null;
    	
    	if(obj==查找){if(课号1.getText().equals("")||学号1.getText().equals(""))JOptionPane.showMessageDialog(this,"请填写完成查询的信息!" );
    	else{
    	     
    	    sql1="select * from SC where Cno='"+课号1.getText()+"' and Sno='"+学号1.getText()+"'";
    	    try{
    	    Connection dbConn1=CONN();
    		stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    		rs1=stmt.executeQuery(sql1);
    	    if(rs1.next()){课程号.setText(rs1.getString("Cno").trim());
    	                   学号.setText(rs1.getString("Sno").trim());
    	                   成绩.setText(rs1.getString("grade").trim());
    	                   saveC=课号1.getText().trim();	
    	                   saveS=学号1.getText().trim();
    	    }
    	    else{JOptionPane.showMessageDialog(this,"没有这个课号的学生" );}
    	    stmt.close();
    	    rs1.close();
    	    }catch(SQLException e1){
    			   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    		   }
    	    }
    	}
    	else{
    		if(obj==删除){if(saveC==null||saveS==null)JOptionPane.showMessageDialog(this,"还没查找需要修改的学生/课程" );
    		else{sql="delete from SC where Cno='"+saveC+"' and Sno='"+saveS+"'";
    		try{
    		    Connection dbConn1=CONN();
    			stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    			stmt.executeUpdate(sql);
    			saveC=null;
    			saveS=null;
    			JOptionPane.showMessageDialog(this,"删除完成" );
    			课程号.setText("");
                学号.setText("");
                成绩.setText("");
    			stmt.close();
    		    }catch(SQLException e1){
    				   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    			   }
    		}
    		}
    }
    }
    public static Connection CONN(){
    	   String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";   //加载JDBC驱动
    	    String dbURL = "jdbc:sqlserver://主机名:1433; DatabaseName=数据库名";   //连接服务器和数据库test
    	   String userName = "sa";   //默认用户名
    	   String userPwd = "密码";   //密码
    	   Connection dbConn=null;
    
    	   try {
    	   Class.forName(driverName);
    	   dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
    	   System.out.println("Connection Successful!");   //如果连接成功 控制台输出Connection Successful!
    	   } catch (Exception e) {
    	   e.printStackTrace();
    	   }
    	   return dbConn;
    }
    
    }
    

    UpdateC

    /*
    UpdateC
    */
    package sc;
    
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import javax.swing.*;
    
    public class UpdateC extends JPanel implements ActionListener{
    	String save=null;
    	JTextField 课号1,课程号,课程名,先修课课程号,学分;
    	JButton 修改,查找;
    	
    public UpdateC(){
    	try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
    	catch(Exception e){System.err.println("不能设置外观:   "+e);}
    	
    	课号1=new JTextField(12);
    	课程号=new JTextField(12);
    	课程名=new JTextField(12);
    	先修课课程号=new JTextField(12);
    	学分=new JTextField(12);
    	修改=new JButton("修改");
    	查找=new JButton("查找");
    	
    	Box box1=Box.createHorizontalBox();//横放box
    	Box box2=Box.createHorizontalBox();
    	Box box3=Box.createHorizontalBox();
    	Box box4=Box.createHorizontalBox();
    	Box box5=Box.createHorizontalBox();
    	Box box6=Box.createHorizontalBox();
    	Box box7=Box.createHorizontalBox();
    	box1.add(new JLabel("课程号:",JLabel.CENTER));
    	box1.add(课程号);
    	box2.add(new JLabel("课程名:",JLabel.CENTER));
    	box2.add(课程名);
    	box3.add(new JLabel("先修课课程号:",JLabel.CENTER));
    	box3.add(先修课课程号);
    	box4.add(new JLabel("学分:",JLabel.CENTER));
    	box4.add(学分);
    	box6.add(修改);
    	box7.add(new JLabel("课号:",JLabel.CENTER));
    	box7.add(课号1);
    	box7.add(查找);
    	Box boxH=Box.createVerticalBox();//竖放box
    	boxH.add(box1);
    	boxH.add(box2);
    	boxH.add(box3);
    	boxH.add(box4);
    	boxH.add(box5);
    	boxH.add(box6);
    	
    	
    	修改.addActionListener(this);
        查找.addActionListener(this);
    	
    	
    	boxH.add(Box.createVerticalGlue());
    	JPanel picPanel=new JPanel();
    	JPanel messPanel=new JPanel();
    	messPanel.add(box7);
    	picPanel.add(boxH);
    	setLayout(new BorderLayout());
    	JSplitPane splitV=new JSplitPane(JSplitPane.VERTICAL_SPLIT,messPanel,picPanel);//分割
    	add(splitV,BorderLayout.CENTER);
    	validate();
    }
    
    public void actionPerformed(ActionEvent e){
    	Object obj=e.getSource();
    	Statement stmt=null;
    	ResultSet rs=null,rs1=null;
        String sql=null,sql1=null,sqlSC=null;
    	
    	if(obj==查找){if(课号1.getText().equals(""))JOptionPane.showMessageDialog(this,"请填写查询的课号!" );
    	else{
    	    sql1="select * from Course where Cno='"+课号1.getText()+"'";
    	    try{
    	    Connection dbConn1=CONN();
    		stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    		rs1=stmt.executeQuery(sql1);
    	    if(rs1.next()){课程号.setText(rs1.getString("Cno").trim());
            课程名.setText(rs1.getString("Cname").trim());
            先修课课程号.setText(rs1.getString("Cpno").trim());
            学分.setText(rs1.getString("Ccredit").trim());
    	                   save=课号1.getText();	    	
    	    }
    	    else{JOptionPane.showMessageDialog(this,"没有这个课号的课程" );}
    	    stmt.close();
    	    rs1.close();
    	    }catch(SQLException e1){
    			   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    		   }
    	    }
    	}
    	else{
    	if(obj==修改){if(save==null){JOptionPane.showMessageDialog(this,"还没查找需要修改的课程" );}
    	else{
    		if(课程号.getText().equals("")||课程名.getText().equals("")||先修课课程号.getText().equals("")||学分.getText().equals("")){
    			JOptionPane.showMessageDialog(this,"课程信息填满才能修改!" );
    		}
    		else{sql="update Course set Cno='"+课程号.getText()+"',Cname='"+课程名.getText()+"',Cpno='"+先修课课程号.getText()+"',Ccredit='"+学分.getText()+"' where Cno='"+save+"'";
    		if(save.trim().equals(课程号.getText().trim())){
    		try{
    		    Connection dbConn1=CONN();
    			stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    			stmt.executeUpdate(sql);
    			save=null;
    			JOptionPane.showMessageDialog(this,"修改完成" );
    			课程号.setText("");
                课程名.setText("");
                stmt.close();
    		    }catch(SQLException e1){
    				   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    			   }
    	}
    		else{sql1="select * from Course where Cno='"+课程号.getText()+"'";
    		try{
    		    Connection dbConn1=CONN();
    			stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    			rs1=stmt.executeQuery(sql1);
    		    if(rs1.next()){  	JOptionPane.showMessageDialog(this,"已存在此课号课程" );
    		    }
    		    else{sqlSC="update SC set Cno='"+课程号.getText()+"' where Cno='"+save+"'";
    		    stmt.executeUpdate(sql);
    		    stmt.executeUpdate(sqlSC);
    		    	save=null;
    			JOptionPane.showMessageDialog(null,"修改完成" );
    			课程号.setText("");
                课程名.setText("");
                先修课课程号.setText("");
                学分.setText("");}
    		    stmt.close();
    		    rs1.close();
    		    }catch(SQLException e1){
    				   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    			   }
    		}
    	}}}}
    }
    public static Connection CONN(){
    	   String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";   //加载JDBC驱动
    	    String dbURL = "jdbc:sqlserver://主机名:1433; DatabaseName=数据库名";   //连接服务器和数据库test
    	   String userName = "sa";   //默认用户名
    	   String userPwd = "密码";   //密码
    	   Connection dbConn=null;
    
    	   try {
    	   Class.forName(driverName);
    	   dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
    	   System.out.println("Connection Successful!");   //如果连接成功 控制台输出Connection Successful!
    	   } catch (Exception e) {
    	   e.printStackTrace();
    	   }
    	   return dbConn;
    }
    
    }
    
    
    
    

    UpdateS

    /*
    UpdateS
    */
    package sc;
    
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import javax.swing.*;
    
    public class UpdateS extends JPanel implements ActionListener{
    	String save=null;
    	JTextField 学号1,学号,姓名,性别,年龄,所在系系名;
    	JButton 修改,查找;
    	
    public UpdateS(){
    	try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
    	catch(Exception e){System.err.println("不能设置外观:   "+e);}
    	
    	学号1=new JTextField(12);
    	学号=new JTextField(12);
    	姓名=new JTextField(12);
    	性别=new JTextField(12);
    	年龄=new JTextField(12);
    	所在系系名=new JTextField(12);
    	修改=new JButton("修改");
    	查找=new JButton("查找");
    	
    	Box box1=Box.createHorizontalBox();//横放box
    	Box box2=Box.createHorizontalBox();
    	Box box3=Box.createHorizontalBox();
    	Box box4=Box.createHorizontalBox();
    	Box box5=Box.createHorizontalBox();
    	Box box6=Box.createHorizontalBox();
    	Box box7=Box.createHorizontalBox();
    	box1.add(new JLabel("学号:",JLabel.CENTER));
    	box1.add(学号);
    	box2.add(new JLabel("姓名:",JLabel.CENTER));
    	box2.add(姓名);
    	box3.add(new JLabel("性别:",JLabel.CENTER));
    	box3.add(性别);
    	box4.add(new JLabel("年龄:",JLabel.CENTER));
    	box4.add(年龄);
    	box5.add(new JLabel("所在系系名:",JLabel.CENTER));
    	box5.add(所在系系名);
    	box6.add(修改);
    	box7.add(new JLabel("学号:",JLabel.CENTER));
    	box7.add(学号1);
    	box7.add(查找);
    	
    	修改.addActionListener(this);
        查找.addActionListener(this);
    	
    	Box boxH=Box.createVerticalBox();//竖放box
    	boxH.add(box1);
    	boxH.add(box2);
    	boxH.add(box3);
    	boxH.add(box4);
    	boxH.add(box5);
    	boxH.add(box6);
    	boxH.add(Box.createVerticalGlue());
    	JPanel picPanel=new JPanel();
    	JPanel messPanel=new JPanel();
    	messPanel.add(box7);
    	picPanel.add(boxH);
    	setLayout(new BorderLayout());
    	JSplitPane splitV=new JSplitPane(JSplitPane.VERTICAL_SPLIT,messPanel,picPanel);//分割
    	add(splitV,BorderLayout.CENTER);
    	validate();
    }
    
    public void actionPerformed(ActionEvent e){
    	Object obj=e.getSource();
    	Statement stmt=null;
    	ResultSet rs=null,rs1=null;
        String sql=null,sql1=null,sqlSC;
    	
    	if(obj==查找){if(学号1.getText().equals(""))JOptionPane.showMessageDialog(this,"请填写查询的学号!" );
    	else{
    	     
    	    sql1="select * from Student where Sno='"+学号1.getText()+"'";
    	    try{
    	    Connection dbConn1=CONN();
    		stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    		rs1=stmt.executeQuery(sql1);
    	    if(rs1.next()){学号.setText(rs1.getString("Sno").trim());
    	                   姓名.setText(rs1.getString("Sname").trim());
    	                   性别.setText(rs1.getString("Ssex").trim());
    	                   年龄.setText(rs1.getString("Sage").trim());
    	                   所在系系名.setText(rs1.getString("Sdept").trim());
    	                   save=学号1.getText();	    	
    	    }
    	    else{JOptionPane.showMessageDialog(this,"没有这个学号的学生" );}
    	    stmt.close();
    	    rs1.close();
    	    }catch(SQLException e1){
    			   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    		   }
    	    }
    	}
    	else{
    	if(obj==修改){if(save==null){JOptionPane.showMessageDialog(this,"还没查找需要修改的学生" );}
    	else{
    		if(学号.getText().equals("")||姓名.getText().equals("")||性别.getText().equals("")||年龄.getText().equals("")||所在系系名.getText().equals("")){
    			JOptionPane.showMessageDialog(this,"学生信息填满才能修改!" );
    		}
    		else{sql="update Student set Sno='"+学号.getText()+"',Sname='"+姓名.getText()+"',Ssex='"+性别.getText()+"',Sage='"+年龄.getText()+"',Sdept='"+所在系系名.getText()+"'where Sno='"+save+"'";
    		if(save.trim().equals(学号.getText().trim())){
    		try{
    		    Connection dbConn1=CONN();
    			stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    			stmt.executeUpdate(sql);
    			save=null;
    			JOptionPane.showMessageDialog(this,"修改完成" );
    			学号.setText("");
                姓名.setText("");
                性别.setText("");
                年龄.setText("");
                所在系系名.setText("");
    			stmt.close();
    		    }catch(SQLException e1){
    				   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    			   }
    	}
    		else{sql1="select * from Student where Sno='"+学号.getText()+"'";
    		try{
    		    Connection dbConn1=CONN();
    			stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    			rs1=stmt.executeQuery(sql1);
    		    if(rs1.next()){  	JOptionPane.showMessageDialog(this,"已存在此学号学生" );
    		    }
    		    else{
    		    	sqlSC="update SC set Sno='"+学号.getText()+"' where Sno='"+save+"'";
    		    	stmt.executeUpdate(sql);
    		    	stmt.executeUpdate(sqlSC);
    		    	save=null;
    			JOptionPane.showMessageDialog(null,"修改完成" );
    			学号.setText("");
                姓名.setText("");
                性别.setText("");
                年龄.setText("");
                所在系系名.setText("");}
    		    stmt.close();
    		    rs1.close();
    		    }catch(SQLException e1){
    				   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    			   }
    		
    		}
    		
    	}}}}
    }
    public static Connection CONN(){
    	   String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";   //加载JDBC驱动
    	    String dbURL = "jdbc:sqlserver://主机名:1433; DatabaseName=数据库名";   //连接服务器和数据库test
    	   String userName = "sa";   //默认用户名
    	   String userPwd = "密码";   //密码
    	   Connection dbConn=null;
    
    	   try {
    	   Class.forName(driverName);
    	   dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
    	   System.out.println("Connection Successful!");   //如果连接成功 控制台输出Connection Successful!
    	   } catch (Exception e) {
    	   e.printStackTrace();
    	   }
    	   return dbConn;
    }
    
    }
    
    

    UpdateSC

    /*
    UpdateSC
    */
    package sc;
    
    
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    
    import javax.swing.*;
    public class UpdateSC extends JPanel implements ActionListener{
    	String saveC=null;
    	String saveS=null;
    	JTextField 课号1,学号1,学号,课程号,成绩;
    	JButton 修改,查找;
    	
    public UpdateSC(){
    	try {UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());}
    	catch(Exception e){System.err.println("不能设置外观:   "+e);}
    	
    	学号1=new JTextField(12);
    	课号1=new JTextField(12);
    	课程号=new JTextField(12);
    	学号=new JTextField(12);
    	成绩=new JTextField(12);
    	修改=new JButton("修改");
    	查找=new JButton("查找");
    	
    	Box box1=Box.createHorizontalBox();//横放box
    	Box box2=Box.createHorizontalBox();
    	Box box3=Box.createHorizontalBox();
    	Box box4=Box.createHorizontalBox();
    	Box box5=Box.createHorizontalBox();
    	box1.add(new JLabel("课程号:",JLabel.CENTER));
    	box1.add(课程号);
    	box2.add(new JLabel("学号:",JLabel.CENTER));
    	box2.add(学号);
    	box3.add(new JLabel("成绩:",JLabel.CENTER));
    	box3.add(成绩);
    	box4.add(修改);
    	box5.add(new JLabel("课号:",JLabel.CENTER));
    	box5.add(课号1);
    	box5.add(new JLabel("学号:",JLabel.CENTER));
    	box5.add(学号1);
    	box5.add(查找);
    	Box boxH=Box.createVerticalBox();//竖放box
    	boxH.add(box1);
    	boxH.add(box2);
    	boxH.add(box3);
    	boxH.add(box4);
    	boxH.add(Box.createVerticalGlue());
    	
    	修改.addActionListener(this);
        查找.addActionListener(this);
    	
    	JPanel picPanel=new JPanel();
    	JPanel messPanel=new JPanel();
    	messPanel.add(box5);
    	picPanel.add(boxH);
    	setLayout(new BorderLayout());
    	JSplitPane splitV=new JSplitPane(JSplitPane.VERTICAL_SPLIT,messPanel,picPanel);//分割
    	add(splitV,BorderLayout.CENTER);
    	validate();
    }
    public void actionPerformed(ActionEvent e){
    	Object obj=e.getSource();
    	Statement stmt=null;
    	ResultSet rs=null,rs1=null,rsC=null,rsS=null;
    	String sql,sql1,sqlS,sqlC;
    	
    	if(obj==查找){if(课号1.getText().equals("")||学号1.getText().equals(""))JOptionPane.showMessageDialog(this,"请填写完成查询的信息!" );
    	else{
    	    sql1="select * from SC where Cno='"+课号1.getText()+"' and Sno='"+学号1.getText()+"'";
    	    try{
    	    Connection dbConn1=CONN();
    		stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    		rs1=stmt.executeQuery(sql1);
    	    if(rs1.next()){课程号.setText(rs1.getString("Cno").trim());
    	                   学号.setText(rs1.getString("Sno").trim());
    	                   成绩.setText(rs1.getString("grade").trim());
    	                   saveC=课号1.getText().trim();	
    	                   saveS=学号1.getText().trim();
    	    }
    	    else{JOptionPane.showMessageDialog(this,"没有这个课号的学生" );}
    	    stmt.close();
    	    rs1.close();
    	    }catch(SQLException e1){
    			   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    		   }
    	    }
    	}
    	
    	else{
    		if(obj==修改){if(saveC==null||saveS==null)JOptionPane.showMessageDialog(this,"还没查找需要修改的学生/课程" );
    		else{
    			if(课程号.getText().equals("")||学号.getText().equals("")){
    				JOptionPane.showMessageDialog(this,"课程信息填满才能修改!" );
    			}
    		else{
    			sqlC="select * from Course where Cno='"+课程号.getText()+"'";
    	    sqlS="select * from Student where Sno='"+学号.getText()+"'";
    	    sql1="select * from SC where Cno='"+课程号.getText()+"' and Sno='"+学号.getText()+"'";
    	    sql="update SC set Cno='"+课程号.getText()+"',Sno='"+学号.getText()+"',grade='"+成绩.getText()+"' where Cno='"+saveC+"' and Sno='"+saveS+"'";
       try{
    	   Connection dbConn1=CONN();
    		stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    		rsC=stmt.executeQuery(sqlC);
    		if(rsC.next()){
    			rsS=stmt.executeQuery(sqlS);
    			if(rsS.next()){
    			if(课程号.getText().trim().equals(saveC)&& 学号.getText().trim().equals(saveS)){
    			stmt.executeUpdate(sql);	
    			JOptionPane.showMessageDialog(this,"添加成功");
    			saveC=null;
    			saveS=null;
    				}
    			else{rs1=stmt.executeQuery(sql1);
    			if(rs1.next()){JOptionPane.showMessageDialog(this,"学生与课程号以存在,无法修改");}
    			else{
    				stmt.executeUpdate(sql);	
    				JOptionPane.showMessageDialog(this,"添加成功");
    				saveC=null;
    				saveS=null;				
    			}
    			rs1.close();
    			}
    		}						
    			else{JOptionPane.showMessageDialog(this,"该学生不存在,无法修改");}
    			rsS.close();
    		}
    		else{JOptionPane.showMessageDialog(this,"该课程不存在,无法修改");}
    		rsC.close();
    		stmt.close();
       }
       catch(SQLException e1){
    	   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    	   }
    		}
    		}
    }
    }
    }
    public static Connection CONN(){
    	   String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";   //加载JDBC驱动
    	   String dbURL = "jdbc:sqlserver://主机名:1433; DatabaseName=数据库名";   //连接服务器和数据库test
    	   String userName = "sa";   //默认用户名
    	   String userPwd = "密码";   //密码
    	   Connection dbConn=null;
    
    	   try {
    	   Class.forName(driverName);
    	   dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
    	   System.out.println("Connection Successful!");   //如果连接成功 控制台输出Connection Successful!
    	   } catch (Exception e) {
    	   e.printStackTrace();
    	   }
    	   return dbConn;
    }
    
    }
    
    
    
    

    SelC

    /*
    SelC
    */
    package sc;
    import java.sql.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    
    import java.util.*;
    
    public class SelC extends JFrame {
    	Vector rowData, columnNames;
    	Statement stmt=null;
    	    String sql=null;
    	JTable jt = null;
    	JScrollPane jsp = null;
    	PreparedStatement ps=null;
    	ResultSet rs=null;
    	public SelC(String sql1){
    		columnNames = new Vector();
    		// 设置列名
    		columnNames.add("课程号");
    		columnNames.add("课程名");
    		columnNames.add("先修课课程号");
    		columnNames.add("学分");
    		rowData=new Vector();
    		sql=sql1;
    		try{
    		    Connection dbConn1=CONN();
    			stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    			rs=stmt.executeQuery(sql);
    		
    			while(rs.next()){
    				Vector hang = new Vector();
    				hang.add(rs.getString("Cno"));System.out.print(rs.getString("Cno"));
    				hang.add(rs.getString("Cname"));System.out.print(rs.getString("Cname"));
    				hang.add(rs.getString("Cpno"));System.out.print(rs.getString("Cpno"));
    				hang.add(rs.getString("Ccredit"));System.out.print(rs.getString("Ccredit"));
    				rowData.add(hang);}
    				jt=new JTable(rowData,columnNames);
    				jsp=new JScrollPane(jt);
    				this.add(jsp);
    				this.setSize(400,300);
    				this.setVisible(true);
    	}catch(SQLException e1){
    	   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    	   }
    }
    public static Connection CONN(){
    	   String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";   //加载JDBC驱动
    	    String dbURL = "jdbc:sqlserver://主机名:1433; DatabaseName=数据库名";   //连接服务器和数据库test
    	   String userName = "sa";   //默认用户名
    	   String userPwd = "密码";   //密码
    	   Connection dbConn=null;
    
    	   try {
    	   Class.forName(driverName);
    	   dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
    	   System.out.println("Connection Successful!");   //如果连接成功 控制台输出Connection Successful!
    	   } catch (Exception e) {
    	   e.printStackTrace();
    	   }
    	   return dbConn;
    }
    
    }
    
    
    

    SelS

    /*
    SelS
    */
    package sc;
    
    
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import javax.swing.*;
    public class SelS extends JPanel implements ActionListener{
    	JTextField 学号,姓名,性别,年龄,所在系系名;
    	JButton 查找;
    	JTextField 课程号,课程名,先修课课程号,学分;
    	JButton 查找1;
    	JTextField 课号1,学号1,成绩;
    	JButton 查找2;
    
    	public SelS (){
    		学号=new JTextField(12);
    		姓名=new JTextField(12);
    		性别=new JTextField(12);
    		年龄=new JTextField(12);
    		所在系系名=new JTextField(12);
    		课程号=new JTextField(12);
    		课程名=new JTextField(12);
    		先修课课程号=new JTextField(12);
    		学分=new JTextField(12);
    		课号1=new JTextField(12);
    		学号1=new JTextField(12);
    		成绩=new JTextField(12);
    		查找=new JButton("查找学生信息");
    		查找1=new JButton("查找课程信息");
    		查找2=new JButton("查找选课信息");
    	
    		
    		Box box1=Box.createHorizontalBox();//横放box
    		Box box2=Box.createHorizontalBox();
    		Box box4=Box.createHorizontalBox();
    		Box box5=Box.createHorizontalBox();
    		Box box6=Box.createHorizontalBox();
    		Box box7=Box.createHorizontalBox();
    		box1.add(new JLabel("学号:",JLabel.CENTER));
    		box1.add(学号);
    		box1.add(new JLabel("姓名:",JLabel.CENTER));
    		box1.add(姓名);
    		box1.add(new JLabel("性别:",JLabel.CENTER));
    		box1.add(性别);
    		box1.add(new JLabel("年龄:",JLabel.CENTER));
    		box1.add(年龄);
    		box1.add(new JLabel("所在系系名:",JLabel.CENTER));
    		box1.add(所在系系名);
    		box2.add(查找);
    		
    		box4.add(new JLabel("课程号:",JLabel.CENTER));
    		box4.add(课程号);
    		box4.add(new JLabel("课程名:",JLabel.CENTER));
    		box4.add(课程名);
    		box4.add(new JLabel("先修课课程号:",JLabel.CENTER));
    		box4.add(先修课课程号);
    		box4.add(new JLabel("学分:",JLabel.CENTER));
    		box4.add(学分);
    		box6.add(查找1);
    		
    		box5.add(new JLabel("课程号:",JLabel.CENTER));
    		box5.add(课号1);
    		box5.add(new JLabel("学号:",JLabel.CENTER));
    		box5.add(学号1);
    		box5.add(new JLabel("成绩:",JLabel.CENTER));
    		box5.add(成绩);
    		box7.add(查找2);
    
    		Box boxH1=Box.createVerticalBox();//竖放box
    		boxH1.add(box1);
    		boxH1.add(box2);
    		boxH1.add(Box.createVerticalGlue());
    		Box boxH2=Box.createVerticalBox();//竖放box
    		boxH2.add(box4);
    		boxH2.add(box6);
    		boxH2.add(Box.createVerticalGlue()); 
    		Box boxH3=Box.createVerticalBox();//竖放box
    		boxH3.add(box5);
    		boxH3.add(box7);
    		boxH3.add(Box.createVerticalGlue()); 
                   
    		查找.addActionListener(this);
    		查找1.addActionListener(this);
    		查找2.addActionListener(this);
            
    		JPanel messPanel=new JPanel();
    		JPanel picPanel=new JPanel();
    		JPanel threePanel=new JPanel();
    		messPanel.add(boxH1);
    		picPanel.add(boxH2);
    		threePanel.add(boxH3);
    		setLayout(new BorderLayout());
    		JSplitPane splitV=new JSplitPane(JSplitPane.VERTICAL_SPLIT,messPanel,picPanel);//分割
    		add(splitV,BorderLayout.CENTER);
    		JSplitPane splitV1=new JSplitPane(JSplitPane.VERTICAL_SPLIT,splitV,threePanel);//分割
    		add(splitV1,BorderLayout.CENTER);
    		validate();
    		
    	
    	}
    	
    	public void actionPerformed(ActionEvent c){
    		Object obj=c.getSource();
    		Statement stmt=null;
    		ResultSet rs=null;
    		int row=0;
    		int i=0;
    	    String sql=null;
    	    //Student K;
    	    SelC K1;
    	    SelSC K2;
    		if(obj==查找){			
    			if(学号.getText().equals("")&&姓名.getText().equals("")&&性别.getText().equals("")&&年龄.getText().equals("")&&所在系系名.getText().equals("")){
    				sql="select * from Student ";System.out.print("00");//00
    			}
    			else if(学号.getText().equals("")){
    					if(姓名.getText().equals("")){
    						if(性别.getText().equals("")){
    							if(年龄.getText().equals("")) {
    							sql="select * from Student where Sdept like'%"+所在系系名.getText()+"%'";System.out.print("10");
    						}
    							else {
    								if(所在系系名.getText().equals("")) {
    									sql="select * from Student where Sage like'%"+年龄.getText()+"%'";System.out.print("10");
    								}
    								else {sql="select * from Student where Sage like'%"+年龄.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'";}
    								}
    						}
    						else {
    							if(年龄.getText().equals("")) {
    								if(所在系系名.getText().equals("")) {
    									sql="select * from Student where Ssex like'%"+性别.getText()+"%'";System.out.print("10");
    								}
    								else {sql="select * from Student where Ssex like'%"+性别.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'";}
    								
    								
    							}
    								else {
    									if(所在系系名.getText().equals("")) {
    										sql="select * from Student where Sage like'%"+年龄.getText()+"%'and Ssex like '%"+性别.getText()+"%'";System.out.print("10");
    									}
    									else {sql="select * from Student where Sage like'%"+年龄.getText()+"%'and Ssex like '%"+性别.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'";}
    									}
    					}
    					
    					}
    					else{
    						if(性别.getText().equals("")){
    							if(年龄.getText().equals("")) {
    								if(所在系系名.getText().equals("")) {
    									sql="select * from Student where Sname like'%"+姓名.getText()+"%'";System.out.print("10");
    								}
    								else {sql="select * from Student where Sname like'%"+姓名.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'";}
    								}
    						
    							else {
    								if(所在系系名.getText().equals("")) {
    									sql="select * from Student where Sname like'%"+姓名.getText()+"%'and Sage like '%"+年龄.getText()+"%'";System.out.print("10");
    								}
    								else {sql="select * from Student where Sname like'%"+姓名.getText()+"%'and Sage like '%"+年龄.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'";}
    								}
    						}
    						
    						else {
    							if(年龄.getText().equals("")) {
    								if(所在系系名.getText().equals("")) {
    									sql="select * from Student where Ssex like'%"+性别.getText()+"%'and Sname like '%"+姓名.getText()+"%'";System.out.print("10");
    								}
    								else {sql="select * from Student where Ssex like'%"+性别.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'and Sname like '%"+姓名.getText()+"%'";}
    								
    								
    							}
    								else {
    									if(所在系系名.getText().equals("")) {
    										sql="select * from Student where Sage like'%"+年龄.getText()+"%'and Ssex like '%"+性别.getText()+"%'and Sname like '%"+姓名.getText()+"%'";System.out.print("10");
    									}
    									else {sql="select * from Student where Sage like'%"+年龄.getText()+"%'and Ssex like '%"+性别.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'and Sname like '%"+姓名.getText()+"%'";}
    									}
    					}
    					}
    			}
    					else{
    						if(姓名.getText().equals("")){
    							if(性别.getText().equals("")){
    								if(年龄.getText().equals("")) {
    									if(所在系系名.getText().equals("")) {
    										sql="select * from Student where Sno like'%"+学号.getText()+"%'";System.out.print("10");
    									}
    									else {sql="select * from Student where Sno like'%"+学号.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'";}
    									
    							}
    								else {
    									if(所在系系名.getText().equals("")) {
    										sql="select * from Student where Sage like'%"+年龄.getText()+"%'and Sno like '%"+学号.getText()+"%'";System.out.print("10");
    									}
    									else {sql="select * from Student where Sage like'%"+年龄.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'and Sno like '%"+姓名.getText()+"%'";}
    									}
    							}
    							else {
    								if(年龄.getText().equals("")) {
    									if(所在系系名.getText().equals("")) {
    										sql="select * from Student where Ssex like'%"+性别.getText()+"%'and Sno like '%"+学号.getText()+"%'";System.out.print("10");
    									}
    									else {sql="select * from Student where Ssex like'%"+性别.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'and Sno like '%"+学号.getText()+"%'";}
    									
    									
    								}
    									else {
    										if(所在系系名.getText().equals("")) {
    											sql="select * from Student where Sage like'%"+年龄.getText()+"%'and Ssex like '%"+性别.getText()+"%'and Sno like '%"+学号.getText()+"%'";System.out.print("10");
    										}
    										else {sql="select * from Student where Sage like'%"+年龄.getText()+"%'and Ssex like '%"+性别.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'and Sno like '%"+学号.getText()+"%'";}
    										}
    						}
    						
    						}
    						else{
    							if(性别.getText().equals("")){
    								if(年龄.getText().equals("")) {
    									if(所在系系名.getText().equals("")) {
    										sql="select * from Student where Sname like'%"+姓名.getText()+"%'and Sno like '%"+学号.getText()+"%'";System.out.print("10");
    									}
    									else {sql="select * from Student where Sname like'%"+姓名.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'and Sno like '%"+学号.getText()+"%'";}
    									}
    							
    								else {
    									if(所在系系名.getText().equals("")) {
    										sql="select * from Student where Sname like'%"+姓名.getText()+"%'and Sage like '%"+年龄.getText()+"%'and Sno like '%"+学号.getText()+"%'";System.out.print("10");
    									}
    									else {sql="select * from Student where Sname like'%"+姓名.getText()+"%'and Sage like '%"+年龄.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'and Sno like '%"+学号.getText()+"%'";}
    									}
    							}
    							
    							else {
    								if(年龄.getText().equals("")) {
    									if(所在系系名.getText().equals("")) {
    										sql="select * from Student where Ssex like'%"+性别.getText()+"%'and Sname like '%"+姓名.getText()+"%'and Sno like '%"+学号.getText()+"%'";System.out.print("10");
    									}
    									else {sql="select * from Student where Ssex like'%"+性别.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'and Sname like '%"+姓名.getText()+"%'and Sno like '%"+学号.getText()+"%'";}
    									
    									
    								}
    									else {
    										if(所在系系名.getText().equals("")) {
    											sql="select * from Student where Sage like'%"+年龄.getText()+"%'and Ssex like '%"+性别.getText()+"%'and Sname like '%"+姓名.getText()+"%'and Sno like '%"+学号.getText()+"%'";System.out.print("10");
    										}
    										else {sql="select * from Student where Sage like'%"+年龄.getText()+"%'and Ssex like '%"+性别.getText()+"%'and Sdept like '%"+所在系系名.getText()+"%'and Sname like '%"+姓名.getText()+"%'and Sno like '%"+学号.getText()+"%'";}
    										}
    						}
    						}
    					}
    			
    			
    			//K=new Student(sql);
    		 }
    		else{if(obj==查找1){
    			if(课程号.getText().equals("")&&课程名.getText().equals("")&&先修课课程号.getText().equals("")&&学分.getText().equals("")){
    				sql="select * from Course ";System.out.print("00");//00
    			}
    			else if(课程号.getText().equals("")){
    					if(课程名.getText().equals("")){
    						if(先修课课程号.getText().equals("")){
    							sql="select * from Course where Ccredit like'%"+学分.getText()+"%'";System.out.print("10");
    						}
    						else {
    							if(学分.getText().equals("")) {sql="select * from Course where Cpno like'%"+先修课课程号.getText()+"%'";System.out.print("10");}
    							else {sql="select * from Course where Cpno like'%"+先修课课程号.getText()+"%'and Ccredit like '%"+学分.getText()+"%'";}
    							}
    					}
    					else {
    						if(先修课课程号.getText().equals("")&&学分.getText().equals("")){
    							sql="select * from Course where Cno like'%"+课程号.getText()+"%'";System.out.print("10");
    						}
    						else {
    							if(先修课课程号.getText().equals("")){
    								sql="select * from Course where Ccredit like'%"+学分.getText()+"%'and Cno like '%"+课程号.getText()+"%'";System.out.print("10");
    							}
    							else {
    								if(学分.getText().equals("")) {sql="select * from Course where Cpno like'%"+先修课课程号.getText()+"%'and Cno like '%"+课程号.getText()+"%'";System.out.print("10");}
    								else {sql="select * from Course where Cpno like'%"+先修课课程号.getText()+"%'and Cno like '%"+课程号.getText()+"%'and Ccredit like '%"+学分.getText()+"%'";}
    						}
    					}
    				}
    			}
    				else {
    						if(课程名.getText().equals("")){
    							if(先修课课程号.getText().equals("")){
    								if(学分.getText().equals("")) {
    								sql="select * from Course where Cno like'%"+课程号.getText()+"%'";System.out.print("10");
    							}
    							else {sql="select * from Course where Ccredit like'%"+学分.getText()+"%'and Cno like '%"+课程号.getText()+"%'";System.out.print("10");}
    						}
    							else {
    								if(学分.getText().equals("")) {
    									sql="select * from Course where Cpno like'%"+先修课课程号.getText()+"%'and Cno like '%"+课程号.getText()+"%'";System.out.print("10");
    								}
    								else {sql="select * from Course where Ccredit like'%"+学分.getText()+"%'and Cpno like '%"+先修课课程号.getText()+"%'and Cno like '%"+课程号.getText()+"%'";System.out.print("10");}
    							
    							}
    						}
    						else {
    							if(先修课课程号.getText().equals("")){
    								if(学分.getText().equals("")) {
    								sql="select * from Course where Cno like'%"+课程号.getText()+"%'and Cname like '%"+课程名.getText()+"%'";System.out.print("10");
    							}
    							else {sql="select * from Course where Ccredit like'%"+学分.getText()+"%'and Cno like '%"+课程号.getText()+"%'and Cname like '%"+课程名.getText()+"%'";System.out.print("10");}
    						}
    							else {
    								if(学分.getText().equals("")) {
    									sql="select * from Course where Cpno like'%"+先修课课程号.getText()+"%'and Cno like '%"+课程号.getText()+"%'and Cname like '%"+课程名.getText()+"%'";System.out.print("10");
    								}
    								else {sql="select * from Course where Ccredit like'%"+学分.getText()+"%'and Cpno like '%"+先修课课程号.getText()+"%'and Cno like '%"+课程号.getText()+"%'and Cname like '%"+课程名.getText()+"%'";System.out.print("10");}
    							
    							}
    						}
    				}					
    			
    			 K1=new SelC(sql);}
    		else{if(obj==查找2){
    			if(课号1.getText().equals("")&&学号1.getText().equals("")&&成绩.getText().equals("")){
    				sql="select SC.Cno,Cname,SC.Sno,Sname,grade from SC,Course,Student where Course.Cno=SC.Cno and Student.Sno=SC.Sno";System.out.print("000");//000
    			}
    			else{
    				if(课号1.getText().equals("")){
    					if(学号1.getText().equals("")){
    						sql="select SC.Cno,Cname,SC.Sno,Sname,grade from SC,Course,Student where grade like'%"+成绩.getText()+"%' and Course.Cno=SC.Cno and Student.Sno=SC.Sno";System.out.print("001");}
    					else{if(成绩.getText().equals("")){sql="select SC.Cno,Cname,SC.Sno,Sname,grade from SC,Course,Student where SC.Sno like'%"+学号1.getText()+"%' and Course.Cno=SC.Cno and Student.Sno=SC.Sno";System.out.print("010");}
    					     else{sql="select SC.Cno,Cname,SC.Sno,Sname,grade from SC,Course,Student where SC.Sno like'%"+学号1.getText()+"%'and grade like'%"+成绩.getText()+"%' and Course.Cno=SC.Cno and Student.Sno=SC.Sno";System.out.print("011");}}}
    				else{if(学号1.getText().equals("")){
    					      if(成绩.getText().equals("")){sql="select SC.Cno,Cname,SC.Sno,Sname,grade from SC,Course,Student where SC.Cno like'%"+课号1.getText()+"%' and Course.Cno=SC.Cno and Student.Sno=SC.Sno";System.out.print("100");}
    				          else{sql="select SC.Cno,Cname,SC.Sno,Sname,grade from SC,Course,Student where SC.Cno like'%"+课号1.getText()+"%' and grade like'%"+成绩.getText()+"%' and Course.Cno=SC.Cno and Student.Sno=SC.Sno";System.out.print("101");}}
    				     else{if(成绩.getText().equals("")){sql="select SC.Cno,Cname,SC.Sno,Sname,grade from SC,Course,Student where  SC.Cno like'%"+课号1.getText()+"%' and SC.Sno like'%"+学号1.getText()+"%' and Course.Cno=SC.Cno and Student.Sno=SC.Sno";System.out.print("110");}
    				           else{sql="select SC.Cno,Cname,SC.Sno,Sname,grade from SC,Course,Student where  SC.Cno like'%"+课号1.getText()+"%' and SC.Sno like'%"+学号1.getText()+"%' and grade like'%"+成绩.getText()+"%' and Course.Cno=SC.Cno and Student.Sno=SC.Sno";System.out.print("111");}}}
    			}
    			K2=new SelSC(sql);
    			}
    		}
    		}
    		}
    }
    
    

    SelSC

    /*
    SelSC
    */
    package sc;
    
    
    import java.sql.*;
    import javax.swing.*;
    //import connection.java;
    import java.util.*;
    
    public class SelSC extends JFrame {
    	Vector rowData, columnNames;
    	Statement stmt=null;
        String sql=null;
    	JTable jt = null;
    	JScrollPane jsp = null;
    	PreparedStatement ps=null;
    	ResultSet rs=null;
    	public SelSC(String sql1){
    		columnNames = new Vector();
    		// 设置列名
    		columnNames.add("课程号");
    	
    		columnNames.add("学号");
    		
    		columnNames.add("成绩");
    
    		rowData=new Vector();
    		sql=sql1;
    		try{
    		    Connection dbConn1=CONN();
    			stmt=(Statement)dbConn1.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    			rs=stmt.executeQuery(sql);
    			
    			while(rs.next()){
    				Vector hang = new Vector();
    				hang.add(rs.getString("Sno"));System.out.print(rs.getString("Sno"));
    				hang.add(rs.getString("Cno"));System.out.print(rs.getString("Cno"));
    				
    				
    				hang.add(rs.getString("grade"));System.out.println(rs.getString("grade"));
    				rowData.add(hang);}
    				jt=new JTable(rowData,columnNames);
    				jsp=new JScrollPane(jt);
    	this.add(jsp);
    	this.setSize(400,300);
    	this.setVisible(true);
    		}catch(SQLException e1){
    				   System.out.print("SQL Exception occur.Message is:"+e1.getMessage());
    			   }
    		}
    	public static Connection CONN(){
    		   String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";   //加载JDBC驱动
    		    String dbURL = "jdbc:sqlserver://主机名:1433; DatabaseName=数据库名";   //连接服务器和数据库test
    	   String userName = "sa";   //默认用户名
    	   String userPwd = "密码";   //密码
    		   Connection dbConn=null;
    
    		   try {
    		   Class.forName(driverName);
    		   dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
    		   System.out.println("Connection Successful!");   //如果连接成功 控制台输出Connection Successful!
    		   } catch (Exception e) {
    		   e.printStackTrace();
    		   }
    		   return dbConn;
    	}
    
    }
    
    
    展开全文
  • 数据库课程设计报告-学生成绩管理系统引 言在现代,高科技的飞跃发展,计算机的大量普及,使得人们生活节奏越来越快。因此对教育行业的多元信息进行有效的管理工作,也成为教育行业中的重中之重。目前,学校工作繁杂...
  • 学生成绩管理系统 | 数据库设计2

    千次阅读 2021-02-01 22:20:37
    学生成绩管理系统 — - 数据库设计2 详细文档已经分享 一、需求分析 能够进行数据库的数据定义、数据操纵、数据控制等处理功能,进行联机处理的相应时间要短。 具体功能应包括:系统应该提供课程安排数据的插入、...
  • 数据库设计概述 数据库设计的任务和特点 数据库shi 数据库应用系统设计 数据库文档设计 数据库应用程序设计案例
  • 《(最新整理)学生成绩管理系统数据库设计》由会员分享,可在线阅读,更多相关《(最新整理)学生成绩管理系统数据库设计(18页珍藏版)》请在人人文库网上搜索。1、完整)学生成绩管理系统数据库设计(完整)学生成绩管理...
  • 学生成绩管理系统数据库模板1计算机系综合性实验《数据库课程设计》设计报告设计题目实验学期 至 学年第 学期学生所在系部年级 专业班级学生姓名 学号任课教师实验成绩计算机系制一、需求分析阶段1.信息需求高校学生...
  • 展开全部首先在SQL中利用企业管理器或向导建立一个数据库,命名为学生管理系统,启动SQL Sever服务,运行32313133353236313431303231363533e59b9ee7ad9431333365646235企业管理器,单击要创建数据库的服务器左边的...
  • 学生成绩管理系统系别:软件学院班级:11级数据库2班编辑成员:危末生目 录TOC \o "1-3" \h \z \u 1 可行性研究 22 需求分析 32.1 任务概述 32.1.1系统用户及其全线分析 32.1.2系统功能需求 32.2 运行环境 42.3 系统...
  • Sqlyog (也可采用sql server 、Navicat等数据库管理工具,当然在IDEA中也可进行配置mysql驱动进行管理,以上方式均可) 以上只是我的开发环境,大家不用刻意关注版本问题,基本都可运行 3、数据库准备 字段 准备...
  • 2020-09-08 12:37:45 Line no.:21 Error Code: 1046 - No database selected 连接你的数据库的时候出现了这个错误,可以解答一下吗 QQ:3353459453 第 6 楼CCCandy发表于: 2020-09-08 13:19 47 Query: INSERT INTO `...
  • 学生成绩管理系统数据库精选郑州大学西亚斯国际学院数据库设计论文题 目 学生成绩管理系统数据库 指导老师学生姓名学号4专 业计算机科学与技术班 级 计科1班院系电子信息工程学院目录第一章学生成绩管理系统数据库...
  • 太原科技大学数据库课程设计报告系 院 应用科学学院年 级 2013级专 业 信息与计算科学131802学 号 201318030204学 生 姓 名 XXXXXX指导教师姓名 XXXXXX课程设计(论文)题目 太原科技大学学生管理系统目 录第一章 绪 ...
  • 文章目录《数据结构课程设计》——学生成绩档案管理系统(代码实现)前言一、学生类二、管理员类三、学生操作类:四、管理员操作类:五、学生信息保存类:六、管理员信息保存类:七、数据库类八、系统实现类:九、主...
  • 学校机房管理系统数据库课程设计.doc 数据库原理及应用课程设计设计报告题目机房管理系统后台数据库学号131007220学生姓名指导教师提交时间2015/1/4目录第1章需求分析111课程设计概述112主要功能1第2章概念结构设计...
  • 目录学生管理系统数据库设计学生管理系统功能介绍数据库设计步骤第1步: 找对象第2步:找属性第3步: 找关系建表原则第4步: 找特例: 等级明显而且不包含敏感数据的信息建议保持为1张表总结: 数据库设计遵循的原则[重点]...
  • 菜单图形化界面: package sc; import java.awt.*;... AddS 增加学生界面; UpdateS 修改学生界面; DelS 删除学生界面; AddC 增加课程界面; DelC 删除课程界面; UpdateC 修改课程界面; AddSC 增加选课界面; De
  • 题目:学生信息管理系统1 系统需求分析学校每年都有新生入学、老生毕业,还有其他各种人事变动。如何有效地管理这些学生的信息,帮助学校和老师掌握学生的情况,这就是学生信息管理系统需要完成的功能。1.1 系统功能...
  • JAVA数据库课程设计--学生选课管理系统的设计与实现(完整源代码)第 PAGE \* Arabic \* MERGEFORMAT 24 页一、课程设计目的通过这次的设计,主要是做出一个小型的管理系统,来加强对JAVA所学知识的巩固和融会贯通,...
  • 数据库课设之学生成绩管理系统

    千次阅读 2020-04-11 12:59:34
    总体任务是实现学生信息关系的系统化、规范化和自动化,其主要任务是用计算机对学生信息进行日常管理,如查询、修改、增加、删除,另外还考虑到用户登录的权限,针对学生信息和权限登录的学生成绩管理系统。...
  • java课程设计学生成绩管理系统 小组成员
  • 学生成绩管理系统 1. 功能模块与界面 (1)教师,学生登录 (2)学生显示自己的全部信息 (3)教师选择功能:课程管理,成绩录入,成绩查询,成绩修改,成绩删除,学生管理。 (4)课程管理中可以添加,修改,...
  • 一、团队课程设计博客链接二、个人负责模块或任务说明学生成绩录入显示所有学生信息显示各科平均成绩显示学生成绩(按降序排序)三、自己的代码提交记录截图四、自己负责模块或任务详细说明1.学生成绩录入首先要选择所...
  • 一、团队介绍名字负责任务界面层GUI和登录功能的实现业务逻辑层基本功能的实现随机生成十万学生数据信息和学生成绩的可视化分析(柱状图)(可点击姓名进入个人博客)二、系统功能1. 登录界面实现验证码验证2. 添加学生...
  • 存档资料 成绩:华东交通大学课 程 设 计 报 告 书所属课程名称 数据库技术及应用 (A)课程设计题 目 学生学籍管理系统数据库设计与查询分 院专业班级学 号学生姓名指导教师2013年 12 月 30 日1华东交通大...
  • 1、问题描述设计一个学生成绩管理系统,通过此系统可以实现如下功能:(1)能输入并显示n个学生信息和m门考试科目的成绩,计算各个学生的总分和平均分,结果写入原始数据文件并按格式打...1、问题描述设计一个学生成绩...
  • Java课程设计-学生成绩管理系统

    千次阅读 热门讨论 2021-12-14 14:26:54
    ????作者主页:疯狂行者???? ?...、【计算机源码之家】公号作者✌ 简历...计算机课程设计|毕业设计之学生成绩管理系统代码-基于JavaWeb的学生成绩管理系统 文章目录计算机课程设计|毕业设计之学生成绩管理系统代码-基于Ja

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 19,387
精华内容 7,754
关键字:

学生成绩管理系统数据库课程设计