资源目录
压缩包内文档预览:(预览前20页/共54页)
编号:32174090
类型:共享资源
大小:22.69MB
格式:RAR
上传时间:2019-12-18
上传人:遗****
认证信息
个人认证
刘**(实名认证)
湖北
IP属地:湖北
25
积分
- 关 键 词:
-
教务
系统
设计
- 资源描述:
-
教务评教系统设计,教务,系统,设计
- 内容简介:
-
华科学院HUAKE INSTITUTE OF TAIYUAN UNIVERSITY OF SCIENCE & TECHNOLOGY 毕业设计(论文)题目: 教师评教系统学 生 姓 名 陈微 学 号 201022030102 班 级 计算机102201H 所属院(系) 计算机科学与技术系 指 导 教 师 王丽霞 2014 年 6 月 1 日太原科技大学毕业设计(论文)任务书学院(直属系):计算机科学与技术系 时间: 2013年 3 月 4 日学 生 姓 名陈微指 导 教 师王丽霞设计(论文)题目教师评教系统主要研究内容1.Java面向对象程序设计2.JavaEE企业开发方式以及相关技术研究方法主要技术指标(或研究目标)JavaEE核心技术(java、jsp、jdbc、myeclipse、sqlserver)主要参考文献1 王家华软件工程M,沈阳:东北大学出版社,2011,46-199。2 李金山. 学生信息管理系统的设计J.太原:科技情报开发与经济2012,(14):132.3 黄理,李积善,曹林有,张勇.用JSP轻松开发Web网站(第一版)M.北京:北京希望电子出版社.2011.100152. 4 王小铭.管理信息系统及其开发技术M修订版.北京:电子工业出版社,20125 Jame Gosling,Bill Joy,Guy L. Steele Jr,Gilad BrachaJava语言规范M,北京:机械工业出版社,2006,165-173教务评教系统的开发与实现摘要 网络的迅猛发展,21世纪的今天人类社会已经进入到了信息化的时代,更是网络化高速发展的阶段。网络逐渐走进人们的生活,五彩缤纷的网上信息与人们的生活密切相关。互联网成为人们快速获取、发布和传递信息的重要渠道,它在人们政治、经济、生活等各个方面发挥着重要的作用,它的实时性、方便性得到了人们的喜爱。实现信息的集中化管理,让人们更快捷地获取需要的信息。随着计算机技术的飞速发展,高校也已进入信息化时代。教师教学质量评价系统对审核教师的教学质量起着关键的作用。但是传统的教学质量评价以“座谈会”、“问卷调查”等方式为主,主要采用“人工形式发放调查表,学生手工填写,统计员手工录入”的方式,其弊端体现为:评教信息反馈滞后,调查人数与调查地点等方面受时间、空间的限制,后期统计分析工作也较为繁琐,不能很好地满足透明、民主、及时的师生沟通要求。为使教学督导与评教工作进一步规范化、制度化,增强督导与评教的有效性、可操作性和评价的客观性、公正性、准确性,充分发挥学分制对教师教学积极性和学生学习主动性的激发作用,采用先进的网络技术开发基于三层B/S模式的网上评教系统。通过学生网上评教信息的快速反馈,帮助任课教师正确认识自己的教学能力,了解自己的教学水平,充分发挥自身的优势,不断改进教学方法,进一步提高教学质量;通过网上评教,促进师资队伍的群体优化,有力地推动教学改革。本系统是教师教学质量评价系统,功能比较全面,在Web环境下,基于B/S三层结构模式,采用java语言,Jsp技术,MyEclipse为开发工具,结合开发的教师教学质量评价系统。本此论文介绍了总体方案、主要功能模块及其相关实现技术。以及系统有哪些功能模块组成,每个功能模块实现的功能都有哪些。真正做到了促进整个学校乃至社会的教育信息化进程,真正实现教育合理化。关键字: 教师教学质量评价系统;JSP;MyEclipseVITeaching quality evaluation systemAbstractThe rapid development of the network, twenty-first Centuries today, human society has entered into the information age, is the network high speed development stage. The network has gradually into peoples lives, closely related to online information and peoples life a riot of colors. The Internet has become an important channel for people to obtain, release and transfer information, it plays an important role in peoples political, economic, all aspects of life, its real-time, convenience has been loved by the people. Centralized management to realize the information, let people to obtain the required information. With the rapid development of computer technology, colleges and universities have entered the information age. Teaching quality evaluation system for teachers teaching quality audit plays a role of the shutdown button. But the traditional teaching quality evaluation to forum, questionnaire survey mode, mainly uses the artificial form of questionnaires, the students filled out manually, statistician manual entry way, its disadvantages are: evaluation of teaching information feedback delay, survey number and survey sites, time and space constraints, the statistics work is more complicated, cannot satisfy the democratic, transparent, timely communication requirements. In order to make the teaching supervision and evaluation of teaching work further standardized and institutionalized, strengthen supervision and evaluation of teaching effectiveness, operation and evaluation of the objectivity, impartiality, accuracy, give full play to the role of excitation credit on the teachers teaching enthusiasm and initiative of the students, the development of network technology, advanced three layer B/S model based online teaching evaluation system. Student evaluations of teaching through rapid feedback information, to help teachers understand their teaching ability, to understand their teaching level, give full play to their own advantages, improving teaching methods, further improve the quality of teaching; through online teaching evaluation, promote group optimize teacher team, promote teaching reform.6) This system is a teaching quality evaluation system, a more comprehensive function, in the Web environment, based on the B/S three layers structure model, using java language, Jsp technology, MyEclipse as development tool, combined with the teaching quality evaluation system. This paper introduces the overall scheme, main function modules and related technology. And what are the functions of system modules, which are the functions of each module function. To truly promote the process of information of education of the whole school and social education, realize the rationalization.Keywords: Teaching quality evaluation system; JSP; MyEclipse 太原科技大学华科学院毕业设计(论文)目 录摘要I关键字: 教师教学质量评价系统;JSP;MyEclipseIAbstractIIKeywords: Teaching quality evaluation system; JSP; MyEclipseIII第一章 系统概述- 1 -1.1 系统开发背景- 1 -1.2 项目开发的环境- 1 -1.3 技术介绍及开发工具- 1 -1.3.1jsp- 2 -1.3.2 sqlserver- 2 -1.3.3 myeclipse- 2 -1.4 可行性分析- 2 -第二章 系统需求分析- 4 -2.1 系统实现的基本功能- 4 -2.2 数据库设计- 5 -2.2.1数据库概念结构设计- 5 -2.2.2数据库物理设计- 9 -第三章 系统总体设计- 12 -3.1 系统结构- 12 -3.2 系统功能模块设计- 12 -3.2.1 管理员功能模块- 12 -3.2.2 教师功能模块- 13 -3.2.3 学生功能模块- 14 -第四章 系统详细设计和实现- 15 -4.1 人机界面设计- 15 -4.1.1 用户登录首页- 15 -4.1.2管理员修改密码页面- 16 -4.1.3 学生管理页面- 17 -4.1.4 教师管理页面- 17 -4.1.5一级评价指标录入页面- 18 -4.1.6 二级评价指标录入页面- 19 -4.1.7 教师查看评价页面- 19 -4.1.8 查看图形统计页面- 19 -4.1.9 学生个人信息页面- 20 -4.1.10 教学质量评价页面- 20 -4.2 技术介绍- 21 -4.2.2 sqlserver简介- 21 -4.2.3 MyEclipse简介- 23 -4.2.4分类数据库与JavaScript模块- 23 -4.2.5 CSS层- 24 -4.2.6用户登录系统的实现- 24 -4.2.7 修改密码的实现- 26 -4.2.8 学生管理的实现- 26 -4.2.9 教师管理的实现- 26 -4.2.10 一级评价指标录入的实现- 27 -4.2.11 二级评价指标录入的实现- 27 -4.2.12 教师查看评价的实现- 27 -4.2.13 查看图形统计的实现- 28 -4.2.14 个人信息的实现- 29 -4.2.15 教学质量评价的实现- 29 -第五章 测试- 31 -5.1系统测试原理及测试原则- 31 -5.2统测试原理- 31 -5.3系统测试原则- 32 -5.4系统测试的方法- 32 -结束语- 33 -参考文献- 34 -致 谢- 35 -附录 英文资料翻译- 36 -II- 1 -第一章 系统概述1.1 系统开发背景计算机网络的出现带给了世界巨大的变化,从过去只面向专业部门的信息传送扩展到现代生活的各个角落,它为世界的发展和变革做出了无可估量的贡献。网络渐渐的从人们极少了解的领域来到了全世界平常人的生活中。Internet的到来给人们的生活方式带来了翻天覆地的变化,在计算机尚未广泛使用之前,一直以来人们使用传统的人工方式进行的信息的传播,其中存在着许多缺点如:信息量小、内容单一、信息不及时、缺乏准确性,不方便了人们的阅读等。另外将会产生大量的文件和数据,难以管理,这对于查找、更新和维护都带来了许多困难。相比之下,互联网以它快捷、准确、及时、图文并茂的特点夺得了媒体传播中的重要地位,通过互联网我们身边的一切事物变得触手可及,通过互联网我们获得的方式已经和以往大相径庭。同时校园网具有互联网所具备的一切特性。在全球网络化、信息化的今天,校园网迅速发展,大大地方便了人们的生活,不知不觉中,它已经成为人们生活中不可或缺的重要组成部分。近几年来由于高校教学管理体制不断改革和学生培养机制的调整,办学形式更加多样化,高校的教务部门对信息的处理与分析工作越来越繁重,传统的教学评教管理方式已不适应高校教学管理形势的发展与工作的需要,因此,必须运用计算机及网络信息技术,摸索一种高校管理工作现代化、科学化的模式。计算机技术的应用也已经成为高校教学管理现代化的必然要求。1.2 项目开发的环境操作系统:Windows 7数据库:SqlserverWeb应用服务器:Tomcat开发工具:MyEclipse1.3 技术介绍及开发工具本系统是教师教学质量评价系统,功能比较全面,在Web环境下,基于B/S三层结构模式,采用java语言,Jsp技术,MyEclipse为开发工具,结合开发的教师教学质量评价系统。本此论文介绍了总体方案、主要功能模块及其相关实现技术。以及系统有哪些功能模块组成,每个功能模块实现的功能都有哪些。真正做到了促进整个学校乃至社会的教育信息化进程,真正实现教育合理化。1.3.1jsp本系统采用JSP技术开发。因为JSP与同类的CGI、ASP、PHP相比有着独特的优势。JSP是Sun属下Java soft公司推出的技术,使用的Java语言是ASP、PHP和JSP三者中最新的技术。它以Java Servlet技术为基础,又在许多方面作了改进,并且充分借鉴了ASP和PHP一些合理的地方。而且JSP技术是以JAVA语言为基础的,可以使用JavaBeans组件和自定义标签,因此具有良好的扩展性。1.3.2 sqlserver 美国Microsoft公司推出的一种关系型数据库系统。Sqlserver是一个可扩展的、高性能的、为分布式客户机/服务器计算所设计的数据库管理系统,实现了与Windows.NET的有机结合,提供了基于事务的企业级信息管理系统方案。1.3.3 myeclipseMyEclipse级工作平台(MyEclipse Enterprise Workbench ,简称MyEclipse)是对Eclipse IDE的扩展,利用它我们可以在数据库和Java EE的开发、发布以及应用程序服务器的整合方面极大的提高工作效率。它是功能丰富的Java EE集成开发环境,包括了完备的编码、调试、测试和发布功能,完整支持 ,JSP, CSS, JavaScript, Hibernate等。1.4 可行性分析可行性分析是在全面调查基础上,针对新系统的开发是否具备必要性和可能性,对新系统的开发从技术、经济、运行的方面进行分析和研究,以避免投资失误,保证新系统开发成功。这部分将从以下四个方面进行研究:技术可行性、经济可行性、操作可行性和调度可行性。(1)技术可行性因为计算机硬件的发展已经越来越快,现在PC机的性能已经可以胜任普通网站的web服务器。JSP是Java在Internet/Intranet Web上的重要应用技术,可以和各种Java技术完好的结合在一起从而实现非常复杂的应用。因此得到了广泛的支持和承认,成为一种非常流行的网站开发技术。利用JSP技术可以建立先进、安全和跨平台的动态网站。鉴于JSP技术的成熟与广泛的使用。由于在学习数据库时一直以SQL Server作为例子,所以采用Sqlserver作为数据库的后台。(2)经济可行性经济可行性是指开发并应用此系统,应对其投资成本和未来可能取得的经济利益,权衡其得失。随着计算机软件和硬件技术的飞速发展,计算机软、硬件价格不断下降,以可行的情况下开发这样一个管理系统成本不会很高,经过详细周密的调研,采用功能强大的软件,借鉴成功的实例,及科学的开发方法,可以降低开发成本,达到经济高效的目的,因此改性统在经济可行性上时可行的。(3)操作可行性如今,计算机与网络已经非常地普及。特别是在信息化高需求与快速发展的时代,计算机应用已经成为人们必备的技能。本系统具有友善的用户界面、良好的安全性设置和详细的操作说明,适合教师及学生们使用。第二章 系统需求分析需求分析是在软件开发的初始阶段进行,它对于整个软件开发过程以及软件开发后质量是举足轻重的。随着软件系统复杂性的提高及规模的扩大,需求分析在软件开发中所处的地位愈加突出。所谓需求,是指用户对目标软件系统在功能、行为、性能设计约束等方面的要求。在需求分析的研究中,系统开发人员必须对用户的需求进行调查和分析,结合实际环境的特征,正确定义目标软件的特征。因此,需求分析至关重要。本系统主要实现管理员、教师、学生这三种用户权限,管理员拥有最高权限,进行系统的维护;学生可以在系统中评价教师;教师能够在系统中查看学生对自己的教学情况的评价。2.1 系统实现的基本功能一管理员功能(1)基本操作:管理员在此可以修改自己的登录密码。(2)学生管理:管理员在此进行学生的录入,如学号、院系、姓名、性别、年龄、政治面貌等信息,添加后可以按照学号进行学生的查找,同时可以进行再次编辑或是删除学生信息。(3)老师管理:管理员在此进行老师信息的录入,如姓名、院系、课程、性别、年龄等信息,添加后可以按照老师的姓名进行查找,同时可以删除老师信息。(4)评价一级指标:管理员在此录入一级指标信息,如指标名称、指标权重、指标分数信息的添加。(5)评价二级指标:管理员在此进行评价二级指标的录入,如二级指标名称、指标内容、指标权重、分数信息。二教师功能(1)基本操作:教师在此查看系统基本属性。(2)查看我的评价:教师在系统中查看学生对自己的评价分数。(3)评价统计:在此老师可以通过评价统计图更直观的查看学生对自己的评价。三学生功能(1)我的信息:学生可以查看自己的信息并做出修改。(2)教学质量评价:学生可以对自己的教师做出打分的评价;也可以查看其他学生对此教师的评价;及查看图形统计评价。2.2 数据库设计数据库是数据库应用程序的重要组成部分。一个设计结构合理的数据库对于应用程序的开发效率和程序的性能都是非常重要的。数据库的设计过程大致如下:(1)根据用户需求,确定数据库中要保存的数据信息。对用户需求进行分析时数据库设计的第一个阶段。(2)设计数据库的概念模型。概念模型是按用户的观点来对数据建模,使用与进行信息世界建模的工具。它对整个数据库的设计具有深刻的影响。(3)逻辑结构设计。逻辑结构是把概念结构转化为与所采用的数据库管理系统所支持的数据模型相符合的过程。(4)数据库的实施和维护。2.2.1数据库概念结构设计在设计好前台与后台的功能模块后,就开始进行数据库的设计了。根据网站系统的分析,数据库是整个网站的核心。E-R图E-R图是一种概念模型。概念模型实际上是现实世界到机器世界的一个中间层次。概念模型用于信息世界的建模,使数据库设计人员进行数据库设计的有利工具,也是数据库设计人员和用户之间进行交流的语言,能够方便、直接的表达应该用众的各种语义知识,另一方面他还应该简单、清晰并且易于用户理解7。以下是各个数据表的实体图。本系统的E-R如下所示:(1)erjizhibiao二级指标实体图图 2.1 二级指标实体图(2)fenshu分数实体图图2.2分数实体图(3)t_admin管理员实体图图2.3管理员实体图(4)t_stu学生实体图图2.4学生实体图(5)t_tea教师实体图图2.5教师实体图(6)yijizhibiao一级指标实体图图2.6一级指标实体图2.2.2数据库物理设计表的设计是这次设计的一个核心内容。根据前面对网站前台与后台功能模块的分析和对数据库中实体关系的设计,可以看到网站中所用到的数据信息。(1)erjizhibiao二级指标表二级指标表主要存储主键二级指标名称,二级指标内容,二级指标权重,二级指标分数,一级指标id,是否删除一些信息,具体如表4-1所示:名称数据类型备注erjizhibiao_diint主键erjizhibiao_namevarchar(50)窗体顶端二级指标名称窗体底端erjizhibiao_neirongvarchar(500)窗体顶端二级指标内容窗体底端erjizhibiao_quanzhongnumeric(18, 1)窗体顶端二级指标权重窗体底端erjizhibiao_fenshunumeric(18, 1)窗体顶端二级指标分数窗体底端yijizhibiao_idint窗体顶端一级指标id窗体底端delvarchar(50)是否删除(2)fenshu分数表分数表主要存储主键,分数,二级指标分数id,教师分数id,学生分数i时间一些信息,具体如表4-2所示:名称数据类型备注fenshu_idint主键fenshu_fenshunumeric(18, 1)分数fenshu_erjizhibiao_idint二级指标分数idfenshu_teaIdint教师分数idfenshu_stuIdint学生分数idshijianvarchar(50)时间(3)t_admin管理员表管理员表主要存储主键、用户名、密码信息,具体如表4-3所示:名称数据类型备注userIdint主键userNamevarchar(50)用户名userPwvarchar(50)密码(4)t_stu学生表学生表主要存储主键、学号、姓名、性别、年龄、政治面貌等信息,如表4-4所示:名称数据类型备注stu_idint主键stu_xuehaovarchar(50)窗体顶端学号窗体底端stu_realnamevarchar(50)窗体顶端姓名窗体底端stu_sexvarchar(50)窗体顶端性别窗体底端stu_agevarchar(50)窗体顶端年龄窗体底端stu_zhengzhimianmaovarchar(50)窗体顶端政治面貌窗体底端login_namevarchar(50)窗体顶端登陆账号窗体底端login_pwvarchar(50)窗体顶端登录密码窗体底端delvarchar(50)是否删除stu_Yuanxivarchar(50)院系(5)t_tea教师表教师表主要存储主键、姓名、性别、年龄、登录账号、登录密码、是否删除、院系、课程信息,如表4-5所示:名称数据类型备注tea_idint主键tea_realnamevarchar(50)姓名tea_sexvarchar(50)性别tea_agevarchar(50)年龄login_namevarchar(50)登录账号login_pwvarchar(50)登录密码delvarchar(50)是否删除tea_Yuanxivarchar(50)院系tea_Kcvarchar(50)课程(6)yijizhibiao一级指标表一级指标表主要存储主键,一级指标名称,一级指标内容,一级指标权重,一级指标分数信息,如表4-6所示:名称数据类型备注yijizhibiao_idint主键yijizhibiao_namevarchar(50)一级指标名称yijizhibiao_neirongvarchar(500)一级指标内容yijizhibiao_quanzhongnumeric(18, 2)窗体顶端一级指标权重窗体底端yijizhibiao_fenshunumeric(18, 1)窗体顶端一级指标分数窗体底端delvarchar(50)是否删除第三章 系统总体设计3.1 系统结构系统的后台要对整个网站的信息和数据进行维护。网站前台所显示的信息在后台都应该有对应的维护。这样,除了设计后台的各个管理界面外,为了方便管理员的工作,可以将各个管理的界面结合到一个页面中。在设计好网站前台与后台的结构以后,就将数据库加入到结构中。后台将更新的数据写入到数据库中,前台再将数据库中的信息取出来并显示。本次的系统开发完全是一切为用户着想,界面要美观大方,操作尽量简单明了,使其管理实现规范化、科学化。因为校园内的使用者大多都是普通的用户,并不具备非常专业的计算机类知识,过于复杂的系统将会使系统操作人员不方便使用,因此,简单实用的系统成为了系统意向非常重要的指标,能够适用于任何人群,不需要太多的计算机类知识,仅仅只要求使用的人员具有最基本的计算机知识,即可用系统完成中的基本业务处理,而且系统能够极大的提升工作效率。3.2 系统功能模块设计层次模块结构是将系统划分为若干子系统,子系统下再划分为若干的模块。而模块是指具备有输入输出、逻辑功能、运行程序和内部数据四种属性的一组程序。在结构化系统设计中,通常称为功能模块。合理的功能模块的划分能够极大限度地减少重复劳动、提高开发工作的效率并增大系统的可维护性。教师教学质量评价系统按照功能划分为三种用户权限,管理员、教师、学生,下面分别介绍各个用户的功能。3.2.1 管理员功能模块(1)基本操作:管理员在此可以修改自己的登录密码。(2)学生管理:管理员在此进行学生的录入,如学号、院系、姓名、性别、年龄、政治面貌等信息,添加后可以按照学号进行学生的查找,同时可以进行再次编辑或是删除学生信息。(3)老师管理:管理员在此进行老师信息的录入,如姓名、院系、课程、性别、年龄等信息,添加后可以按照老师的姓名进行查找,同时可以删除老师信息。(4)评价一级指标:管理员在此录入一级指标信息,如指标名称、指标权重、指标分数信息的添加。(5)评价二级指标:管理员在此进行评价二级指标的录入,如二级指标名称、指标内容、指标权重、分数信息管理员功能模块图如图3.1所示:管理员功能模块评价二级指标安全退出老师管理评价一级指标学生管理图3.1管理员功能模块图基本操作3.2.2 教师功能模块(1)基本操作:教师在此查看系统基本属性。(2)查看我的评价:教师在系统中查看学生对自己的评价分数。(3)评价统计:在此老师可以通过评价统计图更直观的查看学生对自己的评价。教师功能模块图如图3.2所示:教师功能模块评价统计查看评价基本操作图3.2教师功能模块图3.2.3 学生功能模块(1)我的信息:学生可以查看自己的信息并做出修改。(2)教学质量评价:学生可以对自己的教师做出打分的评价;也可以查看其他学生对此教师的评价;及查看图形统计评价。学生的功能模块图如图3.3所示:学生功能模块图形统计分数情况教学质量评价我的信息图3.3学生功能模块图第四章 系统详细设计和实现4.1 人机界面设计在上一章着重讨论了系统各个模块功能的设计,并详细分析了每一个模块的功能。在本章将具体讨论如何实现功能模块,最终实现整个系统。从而在编码阶段可以把这个描述直接翻译成用JSP网页设计语言书写的程序。本系统设计的网站在设计过程中包含页面的设计以及客户端验证机制(JavaScript)的设计。JavaScript也叫小脚本语言,而且能够在一定程度上检测网页的错误,从而在一定程度上实现网站的安全。本系统应用服务器端JSP动态网页技术,结合客户端动态网页技术JavaScript无缝结合的设计,从而方便系统的实现。随着科技的高速发展,众多网页制作的应用软件应运而生。相对于传统的动态网页开发工具而言。此外,JSP还具有强大的组件(Java Bean)支持功能,可以方便地实现组件复用,进一步提高了开发效率。4.1.1 用户登录首页本系统分为3个用户权限,都在同一个登录页面登录系统,页面如图4.1,其对应的流程图如图4.2。图4.1 登录页面用户登录的流程图如图4.2所示。开 始结 束接收登录信息查询数据库数据是否正确否是登录失败登录成功图4.2 系统登录流程图4.1.2管理员修改密码页面管理员在此可以修改自己的登录密码,见图4.3所示, 图4.3修改密码页面流程图如图4.4所示。开 始结 束接收修改密码信息将信息更新到数据库中更新是否成功否是修改失败修改成功图4.4 修改密码流程图4.1.3 学生管理页面管理员在此进行学生的录入,如学号、院系、姓名、性别、年龄、政治面貌等信息,添加后可以按照学号进行学生的查找,同时可以进行再次编辑或是删除学生信息。运行结果如图4.5所示。图4.5 学生管理页面4.1.4 教师管理页面管理员在此进行老师信息的录入,如姓名、院系、课程、性别、年龄等信息,添加后可以按照老师的姓名进行查找,同时可以删除老师信息。如图5.6所示:图4.6 教师管理页面其中教师查询模块流程图如图4.7所示。开 始结 束接收条件信息查询数据库教师是否存在否是显示出教师信息无该教师图4.7设置角色权限页面4.1.5一级评价指标录入页面管理员在此录入一级指标信息,如指标名称、指标权重、指标分数信息的添加。如图4.8所示:图4.8 一级评价指标录入页面4.1.6 二级评价指标录入页面管理员在此进行评价二级指标的录入,如二级指标名称、指标内容、指标权重、分数信息。如图4.9所示:图4.9 二级评价指标录入页面4.1.7 教师查看评价页面教师在系统中查看学生对自己的评价分数。如图4.10所示。图4.11 教师查看评价页面4.1.8 查看图形统计页面在此老师可以通过评价统计图更直观的查看学生对自己的评价,如图4.11所示。图4.12 查看图形统计页面4.1.9 学生个人信息页面学生可以查看自己的信息并做出修改。如图4.12所示:图4.12查看个人信息页面4.1.10 教学质量评价页面学生可以对自己的教师做出打分的评价,如图4.13所示:图4.13评价分数页面4.2 技术介绍4.2.1jsp技术本系统采用JSP技术开发。因为JSP与同类的CGI、ASP、PHP相比有着独特的优势。JSP是Sun属下Java soft公司推出的技术,使用的Java语言是ASP、PHP和JSP三者中最新的技术。它以Java Servlet技术为基础,又在许多方面作了改进,并且充分借鉴了ASP和PHP一些合理的地方。而且JSP技术是以JAVA语言为基础的,可以使用JavaBeans组件和自定义标签,因此具有良好的扩展性。JSP的优点如下:(1)借助JSP技术,Web网页设计人员可以使用HTML或者XML标记来设计和风格化Web页面,使用JSP标记来生成动态Web页面。JSP引擎负责解释JSP标记和脚本,然后将结果以HTML页面等形式发送回浏览器。这样开发者可以保护自己的核心代码,同时可以保证任何Web浏览器的高度兼容性。(2)JSP页面可借助可重用的、跨平台的组件(JavaBean),来执行Web应用所要求的极为复杂的业务处理。(3)通过开发定制化的标签库等方法,JSP技术可以支持动态扩展技术。(4)作为Java2的一个重要组成部分,JSP技术能够支持高度复杂的、基于Web的企业级应用。JSP技术可以轻松地与现有多种应用体系架构整合,可以充分利用已有开发工具和技巧,并扩展到企业级分布式应用环境 。4.2.2 sqlserver简介美国Microsoft公司推出的一种关系型数据库系统。Sqlserver是一个可扩展的、高性能的、为分布式客户机/服务器计算所设计的数据库管理系统,实现了与Windows.NET的有机结合,提供了基于事务的企业级信息管理系统方案。 SQL语句可以用来执行各种各样的操作,例如更新数据库中的数据,从数据库中提取数据等。目前,绝大多数流行的关系型数据库管理系统,如Oracle, Sybase ,Microsoft SQL Server, Access等都采用了SQL语言标准。虽然很多数据库都对SQL语句进行了再开发和扩展,但是包括Select, Insert ,Update ,Delete, Create,以及Drop在内的标准的SQL命令仍然可以被用来完成几乎所有的数据库操作。SQL Server 是一个关系数据库管理系统。它最初是由Microsoft Sybase 和Ashton-Tate三家公司共同开发的,于1988 年推出了第一个OS/2 版本。在Windows NT 推出后,Microsoft与Sybase 在SQL Server 的开发上就分道扬镳了,Microsoft 将SQL Server 移植到Windows NT系统上,专注于开发推广SQL Server 的Windows NT 版本。Sybase 则较专注于SQL Server在UNIX 操作系统上的应用。SQL Server 是Microsoft 公司推出的SQL Server 数据库管理系统,该版本继承了SQL Server 7.0 版本的优点,同时又比它增加了许多更先进的功能。具有使用方便可伸缩性好与相关软件集成程度高等优点,可跨越从运行Microsoft Windows 98 的膝上型电脑到运行Microsoft Windows 的大型多处理器的服务器等多种平台使用。这个平台有以下特点:可信任的使得公司可以以很高的安全性、可靠性和扩展性来运行他们关键任务的应用程序。高效的使得公司可以降低开发和管理他们的数据基础设施的时间和成本。智能的提供了一个全面的平台,可以在你的用户需要的时候给他发送观察和信息。一、可信任的保护你的信息在过去的SQL Server 2005的基础之上,SQL Server 2008做了以下方面的增强来扩展它的安全性:* 简单的数据加密SQL Server 2008可以对整个数据库、数据文件和日志文件进行加密,而不需要改动应用程序。进行加密使公司可以满足遵守规范和及其关注数据隐私的要求。简单的数据加密的好处包括使用任何范围或模糊查询搜索加密的数据、加强数据安全性以防止未授权的用户访问、还有数据加密。这些可以在不改变已有的应用程序的情况下进行。* 外键管理SQL Server 2008为加密和密钥管理提供了一个全面的解决方案。为了满足不断发展的对数据中心的信息的更强安全性的需求,公司投资给供应商来管理公司内的安全密钥。SQL Server 2008通过支持第三方密钥管理和硬件安全模块(HSM)产品为这个需求提供了很好的支持。* 增强了审查SQL Server 2008使你可以审查你的数据的操作,从而提高了遵从性和安全性。审查不只包括对数据修改的所有信息,还包括关于什么时候对数据进行读取的信息。SQL Server 2008具有像服务器中加强的审查的配置和管理这样的功能,这使得公司可以满足各种规范需求。SQL Server 2008还可以定义每一个数据库的审查规范,所以审查配置可以为每一个数据库作单独的制定。为指定对象作审查配置使审查的执行性能更好,配置的灵活性也更高。4.2.3 MyEclipse简介MyEclipse级工作平台(MyEclipse Enterprise Workbench ,简称MyEclipse)是对Eclipse IDE的扩展,利用它我们可以在数据库和Java EE的开发、发布以及应用程序服务器的整合方面极大的提高工作效率。它是功能丰富的Java EE集成开发环境,包括了完备的编码、调试、测试和发布功能,完整支持 ,JSP, CSS, JavaScript, Hibernate等。MyEclipse 是一个十分优秀的用于开发Java, J2EE的 Eclipse 插件集合,MyEclipse的功能非常强大,支持也十分广泛,尤其是对各种开源校园教学软件的支持十分不错。MyEclipse目前支持Java Servlet, AJAX, JSP, JSF, Struts, Spring, Hibernate,EJB3,JDBC数据库链接工具等多项功能。可以说MyEclipse是几乎囊括了目前所有主流开源校园教学软件的专属eclipse开发工具。MyEclipse结构上的这种模块化,可以让我们在不影响其他模块的情况下,对任模块进行单独的扩展和升级。简单而言,MyEclipse是Eclipse的插件,也是一款功能强大的Java EE集成开发环境,支持代码编写、配置、测试以及除错,MyEclipse5.5以前版本需先安装Eclipse。MyEclipse5.5以后版本安装时不需安装Eclipse。4.2.4分类数据库与JavaScript模块JDBC(Java Database Connectivity)是sun公司制定的Java分类数据库技术。在安装好数据库后JSP并不能直接与数据库分类8,这里选择利用第三方JDBC驱动程序分类数据库。在项目开发中,如果频繁在JSP页面中使用数据库分类函数,释放函数进行操作的话,势必会非常麻烦,而且代码的冗余量也很大,页面很多的时候维护也会非常麻烦。通过将数据库分类函数代码,释放函数代码等封装在JavaBean中,可以减少非常多的代码编程工作,提高代码可维护性。JavaScript也叫小脚本语言,是一种基于对象和事件驱动并具有安全性能的脚本语言,使用它的目的是与HTML超文本标识语言、Java 脚本语言一起实现在一个网页中分类多个对象,从而可以开发客户端的应用程序。它是通过嵌入或调入在标准的HTML语言中实现的9。4.2.5 CSS层CSS层叠样式表 (Cascading Style Sheet) 是一系列格式规则,它们控制网页内容的外观。使用 CSS 可以非常灵活并更好地控制具体的页面外观,从精确的布局定位到特定的字体和样式。并能极大的方便网页制作的工作7。这次设计中就学习使用了CSS层叠样式表。例如创建了一个名为body的选择器。利用它来统一设计网站内网页背景及外部框架的样式。在声明中规定了页面的背景、滚动条的颜色样式等。4.2.6用户登录系统的实现代码如下:if(userType=0)/系统管理员登陆System.out.println(1111);String sql=from TAdmin where userName=? and userPw=?;Object con=userName,userPw;List adminList=adminDAO.getHibernateTemplate().find(sql,con);System.out.println(adminList.size();if(adminList.size()=0) WebContext ctx = WebContextFactory.get(); HttpSession session=ctx.getSession(); TAdmin admin=(TAdmin)adminList.get(0); session.setAttribute(userType, 0); session.setAttribute(admin, admin); result=yes;if(userType=1)/老师登陆System.out.println(222222);String sql=from TTea where loginName=? and loginPw=?;Object con=userName,userPw;List teaList=teaDAO.getHibernateTemplate().find(sql,con);if(teaList.size()=0) result=no;elseWebContext ctx = WebContextFactory.get(); HttpSession session=ctx.getSession(); TTea tea=(TTea)teaList.get(0); session.setAttribute(userType, 1); session.setAttribute(tea, tea); result=yes;if(userType=2)/学生登陆System.out.println(33333);String sql=from TStu where loginName=? and loginPw=?;Object con=userName,userPw;List stuList=stuDAO.getHibernateTemplate().find(sql,con);if(stuList.size()=0) result=no;elseWebContext ctx = WebContextFactory.get(); HttpSession session=ctx.getSession(); TStu stu=(TStu)stuList.get(0); session.setAttribute(userType, 2); session.setAttribute(stu, stu); / session.setAttribute(teaYuanxi, teaYuanxi); result=yes;4.2.7 修改密码的实现代码如下: public String admin PwEdit(String userPwNew)System .out. println(DDDD); try Thread.sleep(700); catch (InterruptedException e)/ TODO Auto-generated catch blocke.printStackTrace();WebContext ctx = WebContextFactory.get(); HttpSession session=ctx.getSession(); TAdmin admin=(TAdmin)session.getAttribute(admin);admin.setUserPw(userPwNew);adminDAO.getHibernateTemplate().update(admin);session.setAttribute(admin, admin);return yes; 4.2.8 学生管理的实现代码如下:public String stuMana()List stuList=stuDAO.getHibernateTemplate().find(from TStu where del=no);Map request=(Map)ServletActionContext.getContext().get(request);request.put(stuList, stuList);return ActionSupport.SUCCESS;4.2.9 教师管理的实现代码如下:public String teaMana()String sql=from TTea where del=no;List teaList=teaDAO.getHibernateTemplate().find(sql);Map request=(Map)ServletActionContext.getContext().get(request);request.put(teaList, teaList);return ActionSupport.SUCCESS;4.2.10 一级评价指标录入的实现代码如下:public String yijizhibiaoMana()String sql=from Yijizhibiao where del=no ;List yijizhibiaoList=yijizhibiaoDAO.getHibernateTemplate().find(sql);Map request=(Map)ServletActionContext.getContext().get(request);request.put(yijizhibiaoList, yijizhibiaoList);return ActionSupport.SUCCESS;4.2.11 二级评价指标录入的实现代码如下:public String erjizhibiaoMana()String sql=from Erjizhibiao where del=no order by yijizhibiaoId ;List erjizhibiaoList=erjizhibiaoDAO.getHibernateTemplate().find(sql);for(int i=0;ierjizhibiaoList.size();i+)Erjizhibiao erjizhibiao=(Erjizhibiao)erjizhibiaoList.get(i);erjizhibiao.setYijizhibiaoName(yijizhibiaoDAO.findById(erjizhibiao.getYijizhibiaoId().getYijizhibiaoName();Map request=(Map)ServletActionContext.getContext().get(request);request.put(erjizhibiaoList, erjizhibiaoList);return ActionSupport.SUCCESS;4.2.12 教师查看评价的实现代码如下:public String pingFenMy()Map session= ServletActionContext.getContext().getSession();Map request=(Map)ServletActionContext.getContext().get(request);TTea tea=(TTea)session.get(tea);String sql=select sum(fenshuFenshu),fenshuStuId,shijian from Fenshu where fenshuTeaId=+tea.getTeaId()+ group by fenshuStuId,shijian;System.out.println(sql+&);List Fenshulist=fenshuDAO.getHibernateTemplate().find(sql);for(int i=0;iFenshulist.size();i+)Object o=(Object)Fenshulist.get(i);request.put(Fenshulist, Fenshulist);return ActionSupport.SUCCESS;4.2.13 查看图形统计的实现代码如下:public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException HttpSession session = request.getSession(); String teaid = request.getParameter(teaid);TTea tea=(TTea)session.getAttribute(tea);VeagetableDAO dao=new VeagetableDAO();String action=request.getParameter(action);if(action.equalsIgnoreCase(show)List arr=dao.SelectAll(tea);request.setAttribute(arr, arr);request.getRequestDispatcher(show.jsp).forward(request, response);if(action.equalsIgnoreCase(show1)List arr=dao.SelectAll1(teaid);request.setAttribute(arr, arr);request.getRequestDispatcher(show.jsp).forward(request, response);4.2.14 个人信息的实现代码如下:public String stuEditByMe()Map session= ServletActionContext.getContext().getSession();TStu stu=(TStu)session.get(stu);stu.setStuXuehao(stuXuehao);stu.setStuRealname(stuRealname);stu.setStuSex(stuSex);stu.setStuAge(stuAge);stu.setStuZhengzhimianmao(stuZhengzhimianmao);stu.setStuCard(stuCard);stu.setLoginName(loginName);stu.setLoginPw(loginPw);stu.setDel(no);stuDAO.attachDirty(stu);session.put(stu, stu);this.setMessage(操作成功);this.setPath(astu/userinfo/stuinfo.jsp);return succeed;4.2.15 教学质量评价的实现代码如下:public String pingFenMy()Map session= ServletActionContext.getContext().getSession();Map request=(Map)ServletActionContext.getContext().get(request);TTea tea=(TTea)session.get(tea);String sql=select sum(fenshuFenshu),fenshuStuId,shijian from Fenshu where fenshuTeaId=+tea.getTeaId()+ group by fenshuStuId,shijian;List Fenshulist=fenshuDAO.getHibernateTemplate().find(sql);for(int i=0;iFenshulist.size();i+)Object o=(Object)Fenshulist.get(i);request.put(Fenshulist, Fenshulist);return ActionSupport.SUCCESS;第五章 测试5.1系统测试原理及测试原则在完成某一功能模块后,都要进行一下系统测试。检验所完成的这一模块是否能实现预计的功能。其目的是方便整个系统的实现。 5.2统测试原理测试用例的合理性对于软件的测试与评估具有关键作用,而如何使设计的用例、合理并且典型有效并不容易。形成合理的测试用例集。另一方面,软件运行环境的复杂程度对软件评估具有重要作用,所以应产生尽量逼真的运行背景以便于研究。软件测试的周期如图5.1所示。 需求分析 系统设计 编制程序 单元测试 集成测试 系统测试 确认测试使用维护测试阶段开发阶段图5.1 软件测试周期示意图5.3系统测试原则程序员应避免测试自己编写的程序;测试用例的设计必须包括预期的输出结果;测试用例应包括有效的和期望的输入情况,也要包括无效的和不期望的输入情况;所有的测试都应追溯到用户需求,并且计划能够得到保障。只检查程序是否做了它应该做的事这仅完成了测试工作的一半,另一半则是要检查程序是否做了它不该做的事;尽早地和不断地进行软件测试;穷举测试是不可能的,充分覆盖程序逻辑是有可能的。5.4系统测试的方法(1)黑盒测试黑盒测试也称功能测试或数据驱动测试或基于规范的测试,它是在己知产品所应具有的功能的前提下,通过测试来检测每个功能是否都能正常使用,在测试时,把程序看作一个不能打开的黑盒子,并且保持外部信息(如数据库或文件)的完整性。只有把所有可能的输入都作为测试情况使用,才能以这种方法查出程序中所有的错误。实际上测试情况有无穷多个,人们不仅要测试所有合法的输入,而且还要对那些不合法但是可能的输入进行测试。(2)白盒测试白盒测试也称结构测试或逻辑驱动测试或基于实现的测试,它是知道产品内部工作过程。可通过测试来检测产品内部动作是否按照规格说明书的规定止常进行,按照程序内部的结构测试程序.所有逻辑路径进行测试。因此,白盒”法是穷举路径测试。但即使每条路径都测试了仍然可能有错误。第一,穷举路径测试不能查出程序违反了设计规范,即程序本身是个错误的程序。第二,穷举路径测试不可能查出程序中因遗漏路径而出错。第三,穷举路径测试可能发现不了一些与数据相关的错误。结束语此次我们期末项目设计的课题是教师教学质量评价系统,全面实践一个面向数据库的应用系统的开发过程,学习了很多有关的知识。这样的项目队我学过的数据结构、程序设计、数据库、软件工程的那个课程是一个综合性很高的时间。通过这次本科毕业设计,使我对网站开发有了更为深刻的理解,积累了一定的网站建设经验。虽然在去年的生产实习中接触到了网页制作,但是只是比较单一页面的设计,没有综合一个完整的应用项目的各情况。而在这次毕业设计中,通过实际调查研究与编写程序,熟悉了编程环境,掌握了一些社会经验和编程经验,对自己今后的工作和学习有着良好的促进作用。在开发过程中遇到了许多不可预知的困难,但最终在老师和同学的帮助下一一解决了。在解决了各种难题的同时,我也学到了许多技术知识和开发技巧,相信这些知识和技巧将在我的以后工作和学习中发挥作用。当然,由于时间有限,个人能力的不足以及开发经验的缺乏,本系统还有许多需要改进的地方,此外,在以后系统运行的过程中,可能还会遇到些问题,将会在以后有可能的情况下进一步改进系统功能。参考文献1 王家华软件工程M,沈阳:东北大学出版社,2011,46-199。2 李金山. 学生信息管理系统的设计J.太原:科技情报开发与经济2012,(14):132.3 黄理,李积善,曹林有,张勇.用JSP轻松开发Web网站(第一版)M.北京:北京希望电子出版社.2011.100152. 4 王小铭.管理信息系统及其开发技术M修订版.北京:电子工业出版社,20125 Jame Gosling,Bill Joy,Guy L. Steele Jr,Gilad BrachaJava语言规范M,北京:机械工业出版社,2006,165-1736 赵海廷. Java语言程序设计. 武汉大学出版社,20117 朱福喜. 傅建明. 唐晓军.Java项目设计与开发范例电子工业出版社,20058 张新曼精通JSP-Web开发技术与典型应用M ,北京:人民邮电出版社,2007,516-564。9 高英 张晓东 Sqlserver数据库应用系统与实例 人民邮电出版社201210彭勇. 计算机网络基础与Internet应用M北京.电子工业出版社, 200911罗超理.李万红.管理信息系统原理与应用M北京.清华大学出版社,201212张少敏,王保义,基于Web的管理信息系统方案及安全性J华北电力大学报,2011致 谢转眼间,我在大学的生活即将结束。在这几年的时间里,我在学业上和性格上都收获成长了很多。同时令我找到了我人生道路的方向。回顾这段对我来说异常重要的日子,我有太多的感激之情要表达。回忆这几年里的点点滴滴,不禁让我眼眶湿润,还记得刚踏入大学校园时欢乐心情和兴奋的场景。一切仿佛都在眼前,那么富有吸引力,然而又稍纵即逝。有快乐也有艰辛,有收获也有失落。衷心感谢所有支持帮助过我的老师,谢谢你们多年来的关心和爱护。同样难忘的同学友谊,我们一起走过的人生道路上一个不平凡的一段路,给我留下了值得珍藏的记忆。首先要感谢我的导师,能成为您的学生我深感荣幸。感谢您在专业知识上孜孜不倦的教导;感谢您在发展方向上高屋建瓴的指引;感谢您在百忙之中查看并修改我的论文;更要感谢您以身作则教育我成为一个正直、诚信的人。论文是在老师的精心指导下完成的, 论文的选题、初稿、改稿、完稿无不倾注着导师的心血。老师严谨的治学态度、渊博的知识和勤勤恳恳的工作作风,让我受益匪浅。感谢我的同窗同学们,谢谢几年来你们陪伴我一起成长。无论是在学习上还是生活上,同学们的情谊帮助我顺利走过了学生生涯的每个春秋,这份同窗之谊永不褪色。我还要感谢我的母校,以及在大学四年生活中给予我关心和帮助的老师和同学,是他们教会了我专业的知识和做人的道理。通过这次毕业论文我还明白了作为一名计算机专业的大学毕业生,我们要会的不仅仅是编写代码,更重要的是要有整体把握系统软件设计的能力。我会在以后的工作和学习中不断完善自己,为我最热爱的母校争光,为自己翻开辉煌的新篇章。附录 英文资料翻译英文原文:SQL Server Connection BasicsSummarySQL Server clients connect to SQL Server using a stack of APIs, object libraries, and protocols. Ken Henderson walks through eachone and explains how they work and interoperate. (7 printed pages)IntroductionThe top of the stack is the API or object library layer. Applications connect to Microsoft SQL Server through either API functions or interfaces exposed by an object library. Examples of APIs used to access SQL Server include ODBC and DB-Library. Examples of object libraries used to access SQL Server include OLE DB, ADO, and ADO.NET. Because ADO ultimately uses OLE DB to communicate with the server, there are really just two object libraries commonly used by Windows applications to communicate with SQL Server: OLE DB and ADO.NET. Connecting through ADO or ADO.NET is certainly more common than doing so over ODBC (although SQL Servers Query Analyzer and Enterprise Manager still connect over ODBC), so Ill discuss the client-side of SQL Servers connection architecture in terms of ADO/OLE DB and ADO.NET. Most apps these days get to SQL Server by way of an object library rather than ODBC or something similar.ADO and OLE DBOLE DB clients (also known as consumers) communicate with servers and other back-ends by means of a client-side provider. This provider is a set of one or more COM components that translate application requests into network interprocess communication (IPC) requests. In the case of SQL Server, the OLE DB provider that is most commonly used is SQLOLEDB, the Microsoft-provided OLE DB provider for SQL Server. SQLOLEDB comes with SQL Server and is installed as part of the Microsoft Data Access Components (MDAC) stack.Applications that communicate with SQL Server using ADO do so by first establishing a connection to the server using a Connection object. ADOs Connection object accepts a connection string that specifies the OLE DB provider to be used as well as the parameters to pass to it. Youll see SQLOLEDB in this string if an app is connecting to SQL Server using the SQLOLEDB provider.Its also possible for an ADO application to connect over ODBC to SQL Server. To do this, the app uses the OLE DB provider for ODBC and specifies an ODBC data source that references the target SQL Server in its connection string. In this scenario, the application communicates with OLE DB, and the OLE DB provider for ODBC makes the appropriate ODBC API calls to talk to SQL Server. ADO.NETADO.NET applications typically connect to SQL Server using the .NET Framework Data Provider for SQL Server. This native provider allows ADO.NET objects to communicate directly with SQL Server. Typically, an application uses a SqlConnection object to establish a connection, then uses a SqlCommand object to send commands to the server and receive results back from it. The SqlDataAdapter and SqlDataReader classes are typically used in conjunction with SqlCommand to interact with SQL Server from managed code applications.By making use of the OleDbConnection class, ADO.NET applications can also use the SQLOLEDB OLE DB provider to interact with SQL Server. And they can access SQL Server by way of ODBC through the OdbcConnection class. So, from managed code alone, you have three distinct ways of accessing SQL Server from an application. This is good to know from a troubleshooting standpoint because it can help you isolate connection-related problems you encounter to a particular data access layer or library.Client-Side Net-LibrariesThe next layer down in the stack is the Net-Library. A Net-Library provides the conduit between the API or object library an application uses to communicate with SQL Server and the networking protocols used to exchange data with the network. SQL Server provides Net-Libraries for all major networking protocols. These libraries transparently handle sending requests from the client to the SQL Server and returning the servers responses to the client. You can configure which Net-Libraries are available on a particular client using SQL Servers Client Network Utility. Supported client-side protocols include TCP/IP, Named Pipes, NWLink, Multiprotocol (RPC), and a few others. One Net-Library thats worth special mention here is the shared memory Net-Library. As the name suggests, this Net-Library uses Windows shared memory facility to communicate between a SQL Server client and server. Naturally, this means that the client and server must reside on the same physical machine. Because it is able to bypass the physical network stack, the shared memory Net-Library can be considerably faster than other Net-Libraries. Access to the shared memory region is protected by synchronization objects, so the speed of the communication between the client and server is constrained mainly by Windows ability to signal and unsignal kernel objects and processes ability to copy data to and from the shared memory region.You can indicate that the shared memory Net-Library should be used by specifying either a period or (local) as your machine name when connecting. You can also prefix your machineinstance name with lpc: when connecting to indicate that you want to use the shared memory Net-Library.Understand that, even when connecting to a SQL Server on the same machine, the shared memory Net-Library is not necessarily your best connection option. The directness of the connection between the client and server can limit its scalability in some situations. As with other elements in an applications overall architecture, you should always thoroughly test a given technology solution before assuming that it scales well or is faster than alternate approaches.ConnectionsWhen a client connects, SQL Servers user mode scheduler (UMS) component assigns it to a particular scheduler. At startup, SQL Server creates a separate UMS scheduler for each CPU on the system. As clients connect to the server, they are assigned to the scheduler with the fewest number of connections. Once connected, a client never changes schedulersit will remain on its assigned scheduler until it disconnects.This has important implications for applications that establish multiple connections to the server. If an application is poorly designed or does not evenly distribute work across its connections, its possible for the app to cause needless contention for CPU resources between some of its connections, while others remain virtually idle.Say, for example, that at application establishes four connections to SQL Server that is running on a machine with two processors and that connections 1 and 3 end up on processor 0, while connections 2 and 4 end up on processor 1. If the lions share of the apps work is carried out over connections 1 and 3, they will contend for CPU 0 while CPU 1 might remain virtually idle. In this situation, theres nothing the app can do but disconnect/reconnect some of its connections and hope that connections 1 and 3 end up on different CPUs (theres no way to specify processor affinity when connecting) or redistribute its workload across its connections such that they are more balanced. The latter is, of course, far preferable to the former.Connection MemorySQL Server sets aside three packet buffers for every connection made from a client. Each buffer is sized according to the default network packet size specified by the sp_configure stored procedure. If the default network packet size is less than 8KB, the memory for these packets comes from SQL Servers buffer pool. If its 8KB or larger, the memory is allocated from SQL Servers MemToLeave region. Its worth noting that the default network packet size for the .NET Framework Data Provider for SQL Server is 8KB, so the buffers associated with managed code client connections typically come from SQL Servers MemToLeave region. This contrasts with classic ADO applications, where the default packet size is 4KB, and the buffers are allocated form the SQL Server buffer pool.EventsOnce connected, client requests typically fall into one of two broad categories: language events and remote procedure calls. Although there are certainly others, most requests from a SQL Server client to a server consist of one of these two types. A language event is a batch of T-SQL sent from the client to the server. For example, if you call the Execute method of an ADO Command object whose CommandText property is set to a T-SQL query and whose CommandType property is set to adCmdText, the query is submitted to the server as a language event. Likewise, if you set CommandType to adCmdTable and call the Execute method, ADO will generate an internal query that selects all the columns in the table identified by the CommandText property and submit it to the server as a language event. On the other hand, if you set CommandType to adStoredProc, calling Execute will cause ADO to submit a remote procedure call request to the server to execute the stored procedure listed in the CommandText property.Why do you care about whether youre submitting requests to the server as language events or RPCs? You care because RPCs, generally speaking, perform better, especially when youre repeatedly calling the same query with different filter values. Although SQL Server can auto-parameterize plain language event requests, its ability to do so is pretty limited. It will not attempt to auto-parameterize certain types of queries at all. This can cause different executions of what is essentially the same query to incur the cost of plan compilation on the server simply because they filter on different values. Quite often, this is not what you wantyou want to compile a new plan for the first execution of a query, then reuse the plan for subsequent executions that happen to feature different parameters.An RPC, on the other hand, encourages plan reuse by explicitly parameterizing a query rather than relying on the server to do it. A single plan is generated for the first execution of the procedure, and subsequent executions automatically reuse it, even if they supply different values for the parameters. Calling a stored procedure using an RPC versus doing so through a language event not only saves the execution time and CPU resources required for plan compilation, it also makes better use of SQL Servers memory resources because it avoids wasting memory on redundant execution plans.This is the same reason that sp_executesql is generally preferred to EXEC() when executing dynamic T-SQL. Sp_executesql works by creating a stored procedure using the specified query, then calling it using the supplied parameters. Unlike EXEC(), sp_executesql provides a mechanism that allows you to parameterize dynamic T-SQL and encourage plan reuse. A dynamic query that is executed using sp_executesql has a much better chance of avoiding unnecessary compilation and resource costs than one ran using EXEC(). TDSRPCs, language events, and other types of requests sent from a client to SQL Server are formatted into a SQL Server-specific data format known as Tabular Data Stream (TDS). TDS is the language spoken between SQL Server clients and servers. Its exact format is no longer documented, but a client must speak TDS if it wishes to communicate with SQL Server.Currently, SQL Server supports three versions of TDS: TDS 8.0 (for SQL clients), TDS 7.0 (for SQL Server 7.0 clients), and TDS 4.2 (for SQL Server 4.2, 6.0, and 6.5 clients). The only version that completely supports all SQL Server features is TDS 8.0. The others are maintained for backward compatibility.Server-Side Net-LibrariesOn the server side, client requests are initially received by listeners SQL Server sets up to listen on particular networking protocols. These listeners consist of networking libraries on the server and the server-side Net-Libraries that provide a conduit between them and the server. You can configure the protocols on which the server listens using the Server Network Utility. Except when dealing with clusters, SQL Servers support the same range of networking protocols as is supported by clients. For clustered SQL Servers, only TCP/IP and Named Pipes are available.SQL Server sets up one thread per networking protocol on which it listens for client requests, and uses Windows I/O completion port mechanism to wait for and process requests efficiently. As TDS packets are received from the network, the Net-Library listener reassembles them into their original client requests and passes them on to SQL Servers command-processing layer, Open Data Services (ODS).Returning Results to the ClientWhen the server is ready to return results for a particular client request, it uses the same network stack over which the request was initially received. It sends results over the server-side Net-Library to the appropriate networking protocol, and these, in turn, are sent back across the network to the client in TDS format. On the client-side, the TDS packets received from the server are reassembled from the IPC layer by the client-side Net-Library, then forwarded on to the API or object library that initiated the request.Putting It All TogetherDespite all the pieces involved, the roundtrip between a SQL Server client and server can be quite fastsub-second response time is not unusual at all, especially when working with the shared memory Net-Library. There are several data points here that are worth keeping in mind as you build and tune your own SQL Server client applications: If your app runs on the same machine as your SQL Server, consider using the shared memory Net-Library if you arent already. Shared memory Net-Library-based connections are often considerably faster than other types of connections. Keep in mind what I said earlier, though: always thoroughly test a solution and compare it with viable alternatives before assuming that it is inherently better or faster. The proof is in the pudding. Because a client is assigned to a particular UMS scheduler when it first connects and will not leave that scheduler until it disconnects, its important to ensure that an applications workload is balanced across the connections it establishes to the server. Unbalanced workloads can cause unnecessary CPU contention and suboptimal resource usage. The default network packet size you configure on the server and that clients specify when connecting directly affects how much memory they require on the server and the pool from which it is allocated. Keep this in mind as you configure servers for scalability and speed. Also keep in mind that, by default, ADO.NET apps will have a larger network packet size than ADO apps. Generally speaking, you should prefer RPCs to language events when sending requests to the server. Set the appropriate properties in the ADO or ADO.NET objects youre using to facilitate this. When executing dynamic T-SQL, use sp_executesql rather than EXEC() when possible. About the only time this isnt possible is when using EXEC()s ability to concatenate query fragments into dynamic query strings that exceed what can be stored in a single local variable (a rare situation). When you run into client-side problems that you suspect may have to do with the object library or API youre using to reach the server, one troubleshooting technique you can use is to change the client-side mechanism youre using so that you can isolate the problem to a particular component. For example, lets say that you upgrade MDAC and begin seeing 17805 errors in your SQL Server error log indicating that malformed TDS packets are arriving from a client-side ADO application. You might try switching the app to use the OLE DB provider for ODBC, if you can do so without much trouble, to see whether the problem is related to the SQLOLEDB provider in some way. Conversely, if your ADO-based app has been connecting over ODBC, you might switch to SQLOLEDB to see if that remedies the problem or at least helps you narrow the scope. Along these same lines, it sometimes makes sense to change out the Net-Library youre using when troubleshooting connection-related problems. If youre using TCP/IP, perhaps Named Pipes would be worth trying. For example, if youre running into an issue with your DHCP server and dont have a valid IP address, you wont be able to connect to SQL Server using TCP/IP. By switching to Named Pipes, you can quickly isolate the problem to something specific to TCP/IP. On the other hand, if you switch Net Libraries and still have the same problem, you can probably rule out Net-Library-specific issues. Perhaps the server is down or a piece of the network infrastructure between you and the server is not functioning properly. If nothing else, being able to easily change the Net-Library an app uses without having to change the app itself gives you a tool for helping isolate problems. Even if a particular Net-Library isnt viable for you in the long term, temporarily switching a client to use it can help narrow down where a connection-related issue resides.中文译文:SQL Server 连接基础知识摘要SQL Server 客户端通过由 API、对象库和协议组成的堆栈连接到 SQL Server。Ken Henderson 将逐一介绍该堆栈的每个组成部分,并说明它们如何工作以及如何进行交互操作。引言该堆栈的顶部是 API 或对象库层。应用程序通过对象库公开的 API 函数或接口连接到 Microsoft SQL Server。用于访问 SQL Server 的 API 示例包括 ODBC 和 DB-Library。用于访问 SQL Server 的对象库示例包括 OLE DB、ADO 和 ADO.NET。由于 ADO 最终使用 OLE DB 与服务器通信,因此 Windows 应用程序在与 SQL Server 通信时实际上只使用两个常用的对象库,即 OLE DB 和 ADO.NET。由于通过 ADO 或 ADO.NET 进行连接通常比通过 ODBC 进行连接更普遍(但 SQL Server 的查询分析器和企业管理器仍通过 ODBC 进行连接),因此本文将从 ADO/OLE DB 和 ADO.NET 的角度介绍 SQL Server 连接体系结构的客户端。如今,大多数应用程序均通过对象库(而非 ODBC 或类似 API)连接到 SQL Server。ADO 和 OLE DBOLE DB 客户端(也称作使用者)通过客户端提供程序与服务器以及其他后端程序进行通信。此提供程序是一组 COM 组件(一个或多个),用于将应用程序请求转换为网络进程间通信 (IPC) 请求。在使用 SQL Server 的情况下,最常用的 OLE DB 提供程序是 SQLOLEDB,它是 Microsoft 为 SQL Server 提供的 OLE DB 提供程序。SQLOLEDB 随附于 SQL Server 中,并作为 Microsoft 数据访问组件 (MDAC) 库的一部分安装。为了使用 ADO 与 SQL Server 进行通信,应用程序首先使用 Connection 对象建立与服务器的连接。ADO 的 Connection 对象接受一个连接字符串,该字符串指定要使用的 OLE DB 提供程序以及传递给它的参数。如果应用程序使用 SQLOLEDB 提供程序连接到 SQL Server,则该字符串中将显示“SQLOLEDB”。ADO 应用程序还可以通过 ODBC 连接到 SQL Server。为此,应用程序将使用适用于 ODBC 的 OLE DB 提供程序,并指定在其连接字符串中引用目标 SQL Server 的 ODBC 数据源。这种情况下,应用程序与 OLE DB 进行通信,同时 ODBC 的 OLE DB 提供程序调用相应的 ODBC API,以便与 SQL Server 进行会话。 ADO.NETADO.NET 应用程序通常使用 .NET Framework Data Provider for SQL Server 连接到 SQL Server。该本机提供程序使 ADO.NET 对象能够与 SQL Server 直接进行通信。通常,应用程序使用 SqlConnection 对象建立连接,然后使用 SqlCommand 对象向服务器发送命令,并接收服务器返回的结果。SqlDataAdapter 和 SqlDataReader 类通常与 SqlCommand 一起使用,以便通过托管的代码应用程序与 SQL Server 进行交互。通过 OleDbConnection 类,ADO.NET 应用程序还可以使用 SQLOLEDB OLE DB 提供程序与 SQL Server 进行交互。此外,它们可以通过 OdbcConnection 类使用 ODBC 访问 SQL Server。因此,仅通过托管代码,您就有三种不同的方法从应用程序访问 SQL Server。从故障排除的角度而言,了解这些方法是非常有用的,因为它可以帮助您将遇到的与连接相关的问题归结到特定的数据访问层或库。客户端 Net-Library该堆栈中的下一层是 Net-Library。Net-Library 在 API 或对象库(应用程序使用它与 SQL Server 进行通信)与网络协议(用于与网络交换数据)之间提供了一个通道。SQL Server 为所有主要的网络协议提供了 Net-Library。这些库以透明方式将客户端发出的请求发送到 SQL Server,并将服务器发出的响应返回给客户端。可以使用 SQL Server 的客户端网络实用程序配置适用于特定客户端的 Net-Library。支持的客户端协议包括 TCP/IP、命名管道、NWLink、多协议 (RPC) 和其他一些协议。 尤其值得一提的 Net-Library 是共享内存
- 温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

人人文库网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。