203.B基于JSP的酒店客房管理系统 外文文献翻译
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
(
本科毕业外文文献翻译
学生姓名:X X X
学院:信息工程学院
系别:计算机系
专业:软件工程
班级:软件06
指导教师:X X X讲师
二○一○年六月
To connect SQL Server database
First we introduce the basic knowledge of the database, be regarded as the warm-up exercise that study database weave distance front!
1.warm-up exercise
Needing first avowal is relation database that database knowledge that we here introduce all point. The so-called relation database is to mean data as that the form gather, passing to establish simple form an a kind of database for of relation to defining construction.
I ignore the watch at how saving way in physics in the document in database is, it can see to make an a line for with row, with electronics form is similar with the row. In relation database, the line were called the record, but the row then is called word segment.
This form inside each an all in formations for is a record, it including particular customer, but each record then included the same type with the word segment of the quantity: Customer's number, name etc.
Form is logic set that a kind of related information that press a line of arranging with row, similar in single form in work.
Each row of the word a database form inside calls a word segment. Watch is from every kind of word a definition of its containment of, each word a data for describing its implying. While creating to set up a database, the beard assign for each word segment a the piece belongs to the sex with the other according to the type, biggest length. The word segment can include every kind of word sign, arithmetic figure even sketch.
An information of relevant customer deposits in the line of the form, is called record. By any large, arbitrarily two records for database form to create set up can't be same.
Key be a certain word segment( or several words segment) of the form inside, it() for fast inspect but drive index. The key can be unique, and also can then the right and wrong is unique, being decided by it() whether admission repetition. Unique key can specify for main key, using each one that come to unique marking form.
The norm turns the database design of mission be method that the data of buildup, but the data of buildup, should can dissolve otiose repetition, and for have the necessary information offering to check to seek the path quickly. For attaining this kind of target but separate information to the process gone to in every kind of independent form, be called the norm turn.
It is complicated process to use many appointed rules to proceed the norm with the type of the different Class that norm turn. That process studies and discuss already beyond the reach of textual scope. But, the norm of the simple database in majority turn and can use the simple experience in underneath rule completes: include the form of the information of repetition must be divided into independent a few forms dissolve repetition.
If we have chosen to learn 12 curricular 1000 students, the each curricular elucidation will show with the teacher 100 many- to choose that curricular and each
student repeat once. To avoid this kind of low efficiency, should to turn the dichotomous and independent form in form to the norm,an is used to mean the student, the another uses mean the course.
Now the form was turned by the norm, so, to changes the particular and curricular course describe or" data", as long as change a record all right.Is a basic knowledge concerning database above, this is what study database plait distance must. Although the database technique is used as a course, its depth is not this space and can describe with the wide degree of, be used as the primer with simple database plait the distance should be all right already.Like, underneath we can start practicing. We usually meet the database system is to registers the system, ignoring you are in the unit, or attend what buildup, the register is to cans not help of, and it of the construction is more simple, we take a register system as an example. The analysis is once a data for involving.
2. understanding the elements
For the register, want the on the trail of information include:name 、sex、native place、age、date of birth、unit、address、postal service codes、telephone、FAX. Certainly, can create to set up a form in brief, make above each piece according to item to should a word segment.Need to point the form the main key in parties now, in order to unique marking each a record, increase register number conduct and actions unique key respectively in register form, guarantee a two records like this all different.To the database after making an above analysis, we can start establishing the database.
3.set up the firm in camp
Here we study to establish the database how, needing to make sure the type that to establish the database first. Pass in Visual Basic the data interview control piece or data interview object ( DAO) can visit the following database:
1)The database of JET, namely Microsoft Access
2)The database of ISAM, such as: DBase, etc. of FoxPro
3)The database of ODBC, every follow the standard of ODBC customer/ server database. Such as: Microsoft SQL Server, Oracle
By any large, if develop the personal small scaled database system, use Access database comparison accommodation, to develop the big and medium-sized database system uses the database of ODBC fester. But dBase with the database of FoxPro because of already dated, unless special circumstance, do not use otherwise. In our example, chose to use the database of Access certainly. Establish the database of Access contain two kinds of methods: While establishing the database in Microsoft Access. Click" new set up" button can establish the new form. Here we main introduction the second method: The usage can see to turn the data management machine, do not need to weave the distance and then can create to set up the database. Can see to turn the data management machine is the applied procedure of a great use, it is a VB business enterprise version is supplementary with the profession version, in the catalogue\..\ Devastation\ vb\ samples\ the Visdata is next, its interface is as follows the diagram.Click the menu" document" item is next" new set up" son item" Microsoft ACCESS" son item of" edition 7.0 MDB" item. Input the new setting up
the name of the database in flick window way open" register", appear the underneath show the window way:Want the born and new form, the single shot in right key database window way flicks the menu open, then the choice" new form" ordinaries, establishing in" watch construction" dialog box appeared later on a word for wanting segment. The every time faces to join in the form new word segment, single shot" increment word segment" button, will appear of" increment word segment" dialog box."Increment word a type for" options in the dialog box, according to word segment. In our the register database that establish, the type of the each word segment.Want to notice of is, because the word segment registers the number be used unique marking record of, therefore, it can't be inputted by customer. So while defining the word's segment need to be defined for Long data type, the " automatic born word segment" item is valid, and picks out this item. Be the customer like this to input to record with other the different value every input a new record, system would on the word's segment automatically.
In ACCESS database, the key word realizes with the index of, conduct and actions plait distance personnel at gather to weave the distance to the record of the form type, needs to adjust to use index. While searching, the technique of Rushmore uses the index information the excellent turning the search automatically. After completing the form definition, click" increment index" button, flick such aspen figure 5 show the window way.In window way the right side contain three optioned, its meaning, such as table,12.Increase the index dialog box options.After completing such as figure 6.Certainly, the academic association database establishes too not a dynasty the business of the one night, the reader no harm much practices once.
Visit databases design and the development of the application procedures of MS Visual Basics of the databases of the SQL Server. When design a system, the customer still needs to comprehend to use to come to visit the plait distance of ask the data of SQL Server to connect. The origin was detailed to elaborate that the usage open type database conjunction (the Open Database Connectivity, ODBC) adjusts to connect the objects to connect with the class, still having the data interviews object (the Data Access Objects, the DAO) and the long-range data objects.
Design and weave to write large and complicated and applied procedure's database design for the software developer is a challenge, need to choose to weave the distance language and tools, do an accommodation for the SQL Server, choose the calculate way and the data structures, still need to design the sketch customer interface and the application procedures to connect. The decision within the most important software design is applied fixed position of the procedure. In other words, design must specify the system of which parts are data, business rule, and the data entrance procedure and used for circulating the code of other part. The MS Visual Basic supports the plait distance that some databases manage the systems connect, especially SQL Server. Adjust to connect to include the ODBC and DB-Libraries to connect the, object to connect to include the data interview object (DAO), long range data object (the RDO), the OLE DB and the ActiveX Data Objects (ADO) with the class, the SQL that returns the capable SQL Server to manage the mission distributes to manage the object (the SQL Distributed management Objects, SQL-DMO) to
connect. Connect the oculars right choice can improve the whole function of system and the development speed biggest. Design the large data warehouse system needs to choose the applied model properly. Traditional customer/ service's model depends on to join in the center layer but get the improvement to become three layer models. These three layers divide the line system as three parts: each layer is responsible for providing the service:
(1) Data service( the Data Service) contain the maintenance data and the operation date such as the increment, modification, deletion and backups. These services maintenance data relation and contact, support backup and instauration operation. Usually the data service is managed the system usage by the database.
(2) business service( the Business Service) is handled the logic by the business rule and data to constitute, such as the data legitimacy rule, the business processing support and the record backup logics. The main purpose of these services provides the data maintenance toward the application procedure Logic.
(3) expression service( the Presentation Service)( or the customer service) support customer interface, control the customer data to input to express with data.(Output) Notice in customer/ service's technical term, sometimes express the service definition as customer's machine (or head), the data service definition for server (or after carry), but the business service is in the center the layer (the middle layer). But important comprehend any two layers .The data service business service expresses the logic support GUI that the service maintenance database business rule and the processing data need, data importation and manifestation the correspondences can think to carry on between customer's machine and servers. For example, in the center the layer can think is a head.
Server The physics realization of the system can carry on through many different paths. The underneath wills discuss three layer logic models three kinds of to carry out the method:
1.Fat customer machine realization
Many layer (the multi tier) realizations of fat customer the machine realization three layer models of a kind of carry out the options is in the customer's on board movement business and expression services. This probably writes the most common path in the Visual Basic application procedure for the SQL Server. This kind of carries out the physics up only two layers:
The server provides the data service only, this kind of method contain 2:00 shortage. First, was the applied procedure to compute the on board increment at the customer, customer's calculators need to be stronger, this will increase the system expense, because the system usually takes several customer's machines. When the system takes to have the number with thousand million of customer's machine, this kind of method will become too expensive. Another 1:00 shortage is a possible increment maintenance expenses. Move to the change of legitimacy logic and the business rule of the system and will cause upgrade customer's machine procedure each time. If the system contain customer's machine of the equal quantity, this is a problem. The biggest advantage of the machine realization in fat customer is to reduce the network discharge, if the legitimacy and the business rules need not be decide by
the database. Under this kind of circumstance, only pass the data of the legitimacy logic and can spread toward server. Be the example of the importation data legitimacy, suppose the reader to have a small form (for example national form of name) to put in customer's machine. If the data entrance mold piece checks the native watch but is not a more national name in main database, then will reduce the network discharge obviously. Another an important use is in the development process of the system. If the head developer was limited to the interview carry behind, for example, can't pass the data in the database to verify to input the legitimacy, so, this kind of method can make it right processing data.
2. Thin customer machine realization
In thin customer the machine realization, business the service locates the server, the business logic usually expresses for saving process.
The Server, the saving process usages T-The SQL plait write. This kind of realization is like fat customer's machine to carry out the similar physics up only two layers.The advantage of this kind of method is to reduce the system expense, because thin customer's machine needs the less system resources, this have very important many systems of customer's machines to take. And, support the expenses to also compare the fat customer the machine system is a little less, because the code carries the concentrated control in the server.
If the business rule is depend on in the data of the database, thin customer the machine realization reduces the network discharge. The main shortage of this kind of method is a saving process to lack the vivid. The Visual Basic provide stronger than the T-SQL the plait distance ability that have to have another. Notice three the thin customer of the layer model the machine physics realization sometimes is called the fat server (the fat Server) model to confuse with thin customer's machine/ server calculation model by avoid, the latter points a kind of thin customer the machine hardware equipments and techniques are for example the Citric.
3. Many layer realization
Most in brief many layer realizations are three layer realizations, many possible three a kinds of the layer model physics realizations. In this kind of realization, Link the SQL Server usage data service business to serve the " thin" customer of the machine expression service data service business service of fat customer from the Visual Basic the machine expression service data business the service be an alone the progress circulate. That progress can install for serve in the data same set server of the place or at another one server of the dissimilarity. The key characteristics of this kind of realization is the data service, business to serve the different from expression serve to can do for separation of progress movement in calculator. Three layer realizations.
连接SQL Server数据库
我们先介绍一下数据库的基本知识,算是学习数据库编程前的热身运动吧!
1. 热身运动
首先需要声明是,我们这里介绍的数据库知识都是指的关系数据库。
所谓关系数据库就是将数据表示为表的集合,通过建立简单表之间的关系来定义结构的一种数据库。
不管表在数据库文件中的物理存储方式如何,它都可以看作一组行和列,与电子表格的行和列类似。
在关系数据库中,行被称为记录,而列则被称为字段。
此表中每一行是一个记录,它包含了特定客户的所有信息,而每个记录则包含了相同类型和数量的字段:客户号、姓名等等。
表是一种按行与列排列的相关信息的逻辑组,类似于工作单表。
字段数据库表中的每一列称作一个字段。
表是由其包含的各种字段定义的,每个字段描述了它所含有的数据。
创建一个数据库时,须为每个字段分配一个数据类型、最大长度和其它属性。
字段可包含各种字符、数字甚至图形。
记录各个客户有关的信息存放在表的行,被称为记录。
一般来说,数据库表创建时任意两个记录都不能相同。
键键就是表中的某个字段(或多个字段),它(们)为快速检索而被索引。
键可以是唯一的,也可以是非唯一的,取决于它(们)是否允许重复。
唯一键可以指定为主键,用来唯一标识表的每行。
例如,在前面的例子中,客户标识号 (客户号) 是表的主键,因为客户号唯一地标识了一个客户。
关系数据库可以由多个表组成,表与表之间可以以不同的方式相互关联。
规范化数据库设计者的任务就是组织数据,而组织数据的方法,应能消除不必要的重复,并为所有必要信息提供快速查找路径。
为了达到这种目标而把信息分离到各种独立的表中去的过程,叫做规范化。
规范化是用许多指定的规则和不同级别的范式来进行规范的复杂过程。
该过程的研讨已超出了本文的范围。
但是,大多数简单数据库的规范化可以用下面简单的经验规则来完成:包含重复信息的表必须分成独立的几个表来消除重复。
如果有选学了十二门课程的1000名学生,每门课程的说明和教师将显示100多次─ 对选了那门课程的每个学生都要重复一次。
要避免这种低效率,应当把表分成两个独立的表来规范化,一个用来表示学生,另一个用来表示课程。
现在表被规范化了,所以,要改变特定课程的课程描述或“数据”,只要改变一
个记录就可以了。
以上是关于数据库的基本知识,这是学习数据库编程所必须的。
虽然数据库技术作为一门学科,其深度和广度不是这点篇幅能描述的,但作为入门和简单数据库编程应该是足够了。
好了,下面我们就可以开始练练了。
我们经常遇到数据库系统是登记系统,不管你是在单位,或是参加什么组织,登记是免不了的,而且它的结构比较简单,我们就以一个登记系统为例吧。
分析一下该系统所涉及到的数据。
2.磨刀不误砍柴功
对于登记,要跟踪的信息包括:姓名、性别、籍贯、年龄、出生年月、单位、地址、邮政编码、电话、传真当然,可以简单地创建一个表,使得上述的每个数据项对应一个字段。
现在需要给表指派主键,用以唯一标识每一条记录,在登记表中分别添加登记号作为唯一键,这样就保证数据库中的任两条记录都不同了。
对数据库做出以上分析后,我们就可以开始建立数据库了。
3.建营扎寨
在这里我们学习怎样建立数据库,首先需要确定要建立数据库的类型。
在Visual Basic中通过数据访问控件或数据访问对象(DAO)可以访问下列数据库:
1)JET数据库,即Microsoft Access
2)ISAM数据库,如:dBase,FoxPro等
3)ODBC数据库,凡是遵循ODBC标准的客户/服务器数据库。
如:
Microsoft SQL Server、Oracle
一般来说,如果要开发个人的小型数据库系统,用Access数据库比较合适,要开发大、中型的数据库系统用ODBC数据库更为适宜。
而dBase和FoxPro数据库由于已经过时,除非特别的情况,否则不要使用。
在我们的例子中,当然选用Access数据库了。
建立Access数据库有两种方法:一是在Microsoft Access
中建立数据库。
点击“新建”按钮就可以建立新的表了。
这里我们主要介绍第二种方法:使用可视化数据管理器,不需要编程就可创建数据库。
可视化数据管理器是一个非常有用的应用程序,它是VB企业版和专业版附带的,在目录\..\DevStudio\vb\samples\Visdata下。
点击菜单“文件”项下“新建”子项“Microsoft ACCESS”子项的“版本7.0 MDB”项。
要生成新的表,右键单击数据库窗口弹出菜单,然后选择“新表”命令,在
随后出现的“表结构”对话框中建立所要的字段。
每次向表中加入新的字段,单击“增加字段”按钮,会出现“增加字段”对话框。
“增加字段”对话框中的选项,根据字段的类型,有些选项是无效的,无法读取。
在我们建立的登记数据库中,各个字段的类型。
要注意的是,由于字段登记号用来唯一标志记录的,因此,它不能由用户输入。
所以在定义该字段时需要定义为Long数据类型,“自动生成字段”项有效,并选中这一项。
这样当用户每输入一条新记录时,系统就会在该字段上自动输入一个与其它记录不同的值。
在ACCESS数据库中,关键字是用索引实现的,作为编程人员在对表类型的记录集编程时,只需调用索引名。
在查询时,Rushmore技术自动用索引信息优化查询。
完成表定义后,点击“增加索引”按钮,在窗口中右边有三个选项,添加索引对话框选项。
集中讨论软件系统三层模型和模型的不同实现。
当设计一个系统,用户还需要理解用来访问SQL Server 数据的编程接口。
本章详细阐述了使用开放式数据库连接(Open Database Connectivity,ODBC )调用级接口和对象接口,还有数据访问对象(Data Access Objects,DAO)和远程数据对象(Remote Data Objects,RDO)。
为SQL Server设计和编写大型复杂应用程序对于软件开发者是个挑战,需要选择编程语言和工具,做出合适的数据库设计,选择算法和数据结构,还要设计图形用户界面和应用程序接口。
最重要的软件设计中的决定是应用程序的定位。
换句话说,设计者必须指定系统的哪些部分是数据、业务规则、数据入口程序及用于运行代码的其他部分。
MS Visual Basic支持一些数据库管理系统的编程接口,特别是SQL Server。
调用级接口(Call-Level Interface, CLI)包括ODBC和DB-Library接口、对象接口包括数据访问对象(DAO)、远程数据对象(RDO)、OLE DB和ActiveX Data Objects(ADO),还有为SQL Server管理任务的SQL分布管理对象(SQL Distributed management Objects, SQL-DMO)接口。
接口的正确选择能极大地改善整个系统的性能和开发速度。
设计大型的数据仓库系统需要适当地选择应用模型。
传统的客户/服务模型依靠加入中间层而得到改进成为三层模型。
这三个层次将系统划分为三个逻辑构件,每一层都负责提供服务:
(1) 数据服务(Data Service) 有维护数据和操作数据,如增加、修改、删除和存档。
这些服务维护数据关系和联系,支持备份和恢复操作。
通常数据服务由数据库管理系统使用。
(2) 业务服务(Business Service) 由业务规则和数据处理逻辑组成,如数据合法性规则、事务处理支持和记录存档逻辑。
这些服务的主要目的是向应用程序提供数据维护的逻辑。
(3) 表达服务(Presentation Service) (或用户服务)支持用户界面,掌握用户数据输入和数据表达(输出)。
注意在客户/服务术语中,有时表达服务定义为客户机(或前端),数据服务定义为服务器(或后端),而业务服务为中间层(middle layer)。
但是,重要的是理解任何两层的数据服务业务服务表达服务维护数据库业务规则和处理数据所需逻辑支持GUI,数据输入和显示通信都可以认为是在客户机和服务器之间进行的。
比如,中间层可以认为是前端的服务器。
系统的物理实现可通过许多不同途径进行。
下面将讨论三层逻辑模型的三种实现方法:
1. 胖客户机实现
三层模型的一种实现选项是在客户机上运行业务和表达服务。
这大概是为SQL Server写Visual Basic应用程序的最普通途径。
这种实现物理上只有两层,服务器只提供数据服务,这种方法有两点不足。
首先,当应用程序在客户计算机上增加了,客户计算机需要更为强大,这将增加系统开销,因为系统经常带有多个客户机。
当系统带有数以千百万的客户机,这种方法会变得过于昂贵。
另一点不足是可能增加维护费用。
每次对系统的合法性逻辑和业务规则的改动将导致升级客户机程序。
如果系统有相当数量的客户机,这就是个问题。
胖客户机实现的最大优点是减少网络流量,如果合法性和业务规则不必由数据库决定的话。
这种情况下,只有通过合法性逻辑的数据能传向服务器。
作为输入数据合法性的示例,假设读者有一张小表(比如国家名称表)放在客户机里。
如果数据入口模块检查本地表而不是在主数据库里比较国家名称,则显然会减少网络流量。
另一重要用途是在系统的开发过程中。
如果前端开发者被限制了对后端的访问,比如,不能通过数据库里的数据来验证输入合法性,那么,这种方法可以使其正确处理数据。
2. 瘦客户机实现
在瘦客户机实现中,业务服务位于服务器,业务逻辑通常表现为存储过程。
对于SQL。
Server存储过程使用T-SQL编写。
这种实现像胖客户机实现一样物理上只有两层。
这种方法的优点是减少系统开销,因为瘦客户机需要更少的系统资源,这就对带有许多客户机的系统很重要。
而且,维护费用也比胖客户机系统少些,因为
XXX工业大学本科毕业设计外文文献翻译
代码在服务器端集中控制。
如果业务规则依赖于数据库的数据,瘦客户机实现减少网络流量。
这种方法的主要不足是存储过程缺乏灵活性。
Visual Basic提供比T-SQL强得多的编程能力。
注意三层模型的瘦客户机物理实现有时称为胖服务器(fat Server)模型以避免与瘦客户机/服务器计算模型混淆,后者指一种瘦客户机硬件设备和技术比如Cit rix。
3. 多层实现
最简单的多层实现就是三层实现,许多可能的三层模型物理实现的一种。
在这种实现中,从Visual Basic连接SQL Server使用数据服务业务服务“胖”客户机表达服务数据数据服务业务服务“瘦”客户机表达服务数据业务服务作为一个单独进程运行。
该进程可配置为在数据服务所处的同一台服务器或者在另一不同的服务器。
这种实现的关键特点是数据服务、业务服务和表达服务能作为分离的进程运行于不同的计算机。
Internet为三层模型加入新特性,Web技术将表达服务划分为浏览器客户机和Web服务器。
提高客户机数目导致使用类似Microsoft Transaction Server(MTS)的工具,它被设计用来使用COM对象提高中间层灵活性。
划分表达服务或增加COM构件到中间层结果是使物理实现增加层次。
这一途径的好处在于多层系统更具有规模性和灵活性。
如果业务规则占用过多计算机资源,从数据服务中分离出中间层并在单独的计算机上运行代码可能更好些。
但是,这一解决方案增加了网络流量,并且当流量过于密集时系统会慢下来。