当前位置:文档之家› 外文翻译--MySQL和JSP的Web应用程序

外文翻译--MySQL和JSP的Web应用程序

外文翻译--MySQL和JSP的Web应用程序
外文翻译--MySQL和JSP的Web应用程序

MySQL和JSP的Web应用程序JSP开发人员构建Web应用程序时遇到需要强大的数据库连接的特殊问题。MySQL和JSP的Web应用程序解决了构建数据驱动的应用程序JavaServer页面上的发展模式为基础的挑战。 MySQL和JSP的Web应用程序开始一个对JSP数据库开发 - JavaServer页面,JDBC和数据库模式所需的核心技术概述。该书然后概述并提出了互联网商业应用演示,如接收和处理用户输入,设计和实施业务规则,并平衡服务器上的用户负载的概念。通过JDBC(Java数据库连接),开发人员能够与大多数商业数据库如Oracle进行沟通。在MySQL和JSP的Web应用中心提交了一份关于开源工具MySQL和Tomcat的解决方案,使读者一个经济实惠的方式来测试书中的例子的应用程序和试验。

那么JSP是怎么一回事呢?

如果您符合上述要求的,你对这个问题的答案应该已经有一个相当不错的理解。 JSP是所有关于做高度面向对象的网站,可以利用所有的现代软件工程最佳实践。这些做法包括诸如SQL数据库和基于UML设计的东西。这并不是说JSP 是万能的而且使用它会自动将您的网站上的工程艺术的典范。这只是尽可能地用其他任何技术用JSP设计不良网站。这就是为什么,当你详细检查文本的时候,你会看到如何合并最佳方法以及项目得到的压力时候如何避免方便的陷阱。JSP 它本身就是从第一个静态Web服务器开始的一个沿路径循序渐进的步骤,通过CGI移动功能的服务器,最后脚本功能的服务器的第一代。 JSP是一个比Java 引擎能够熟悉网页的的少了一个Java组件的Web服务器。

JSP是由Java servlet发展演变而来的。servlet允许开发人员处理传入使用Java程序能够访问的所有正常的信息,一个共同的网关接口(CGI)程序将Web请求。此外,该servlet可以访问会话持久对象。这是Java的都与一个特定的用户会话,可用于存储请求之间的状态对象。 Servlet编程是一个允许开发人员编写结构良好的模块化的Web应用程序使用面向对象语言的重要一步。它还解决了状态持久性的问题,用户和应用程序执行的一个动作或一系列动作期间让更多的信息驻留在服务器上而且较少的反复在用户和服务器之间传递。Servlet还遭受一大问题。因为他们最终需要输出HTML中,HTML编码必须被嵌入在servlet代码中。导致如下所示的一段代码片段:

Out.println("\n\nThank you for</p><p>Registering\n");

Out.println("");

当你编码很多网页时,这种嵌入式是非常古老非常快的。此外,必须避免所有引号会导致的很多混乱和如果你遗漏了一个反斜杠带来难以发现的错误。最终,一个较好的方法出现。假设你能结合最好的静态HTML页面和servlet的交互能力。其结果是JavaServer页面(在微软方面,结果是活动服务器页面)。JSP 是非常复杂强大的。在接下来的章节中,你会通过这个细节流程,但就目前而言,这里是主要的步骤:

1、接到请求时从使用普通的HTTP请求格式的浏览器。

2、WEB服务器切换到JSP的请求,JSP着眼于找到合适的JSP文件。

3、.jsp文件转换成.Java文件,包含Java代码,将创建一个类,它的名称是从.jsp的文件名而得。

4、JSP然后用javac编译.java文件产生一个.class文件。注意如果一个.class文件已经存在而且比.jsp文件新则可以跳过先前的两步。

5、一个新创建的类实例被实例化,并发送_jspService消息。

6、新的实例看看是否已经有一个被称为user的https://www.doczj.com/doc/eb5020648.html,er对象实例在当前连接的用户会话对象的空间存在。如果没有,一个实例被实例化。

7、作为服务stuff.jsp的一部分,user实例将被GetUserName()方法调用。

8、如果JSP处理需要访问数据库中的信息,它将使用JDBC来进行连接和处理SQL请求。

正如你可以看到,巨大的能量是在现有的JSP世界里。开发者可以自由编写大多数看起来像HTML的Web页面,除非到Java标注是要求最喜欢看的HTML。但是,在同一时间,他们可以自由地充分发展充实面向对象的应用程序使用Java 会带来负担的所有功能。他们也得到servlet的所有优点,包括会话持久性。为什么我们需要的数据库?

好,一个原因就是为了让拉里埃里森想到比尔盖茨的时候,他的Oracle有能力保持自己百忧解。更严重的回答是相同的原因也就是驾驶人先按下针对一块湿粘泥:因为把事情记下来是好的。 Web服务器是了不起的创造,但他们是一个有点像白痴专家。请他们为一个网页或运行Java的一段,他们表演的像一个冠军。但开始要求他们记住他们五分钟前做了什么,和他们显露的比一个肥皂剧

里的人物失忆还快。

第一个也是最重要的原因是你使用的数据库是有大量的数据在电子商务交易里,你必须记住并跟踪:

?一个用户的姓名,地址,信用卡和其他信息以前进入了一个注册页面

?帽子的用户可能把以前留下交易放进购物车

?哪些物品有存货,以及它们的价格,描述等等

?订单需要履行,订单已发货,并已待补物品。

现在,你可以存储所有这些信息在服务器上的硬盘平面文件中,但也有你想保存的数据的其他重要属性:

?如果交易部分失败,您希望能够收回交易。

?您希望能够找到Web服务器安全的地方定位数据,这可能是完全在DMZ或外部的防火墙。

?您希望能够如用户数据或产品快速访问数据,即使有数千或上百万数据。

当你添加这些项目的购物清单,只有一个关系数据库才会真正的影响工作效率。

MySQL

许多网站不需要Oracle的历史优势(和价格标签)。 MySQL是一个开源SQL 数据库可供任何人使用,拥有许多(尽管不是全部)的先前数据库的功能,如Oracle。

MySQL是可用于几乎所有的电脑上有相当好的能力是相当轻量级的处理器,安装方便(10分钟,而不像Oracle需要多个小时)。

所以,也许你想知道,有什么收获?没有得到什么,你在MySQL中,使人们把目光转向到Oracle?那么,MySQL是一个不错的小程序包,但它缺少一些东西,不然会是不错的一个完美的世界。

一个主要特点就是MySQL不提供数据库一致性检查。您可以使用您的模式外键的标签,但MySQL会忽略它们。据我所知许多数据库管理员会认为这是一个很糟糕的事情。

外键约束防止你创建数据不一致。例如,假设你有一个像这样的数据库表:CREATE TABLE USER (

USERID INTEGER,

FIRST_NAME V ARCHAR(80),

LAST_NAME V ARCHAR(80));

CREATE TABLE PURCHASE (

USERID FOREIGN KEY USER(USERID),

ITEM INTEGER,

QUANTITY INTEGER);

在诸如Oracle的数据库里,如果你创建了一个在PURCHASE 表ID为3的用户输入数据库,在USER表里可能已经有一个ID为3的用户或错误会发生。同样,如果它在PURCHASE理是作为参考,你就不能从表USER里删除ID为3的用户,MySQL的人们做了一个漂亮慷慨激昂的论点关于在各自的文档进行数据的完整性取决于外键是无论如何都是一个坏主意,但是说服你的这种哲学的DBA是很可能沦为一个宗教辩论,

此外,其他一些功能缺失,如子查询和SELECT INTO。但可能是其他主要功

能,你会漏掉回滚/提交的功能。 MySQL不会执行回滚和为某些特殊类型的表提交,但他们并不全是。同样,MySQL的人提供他们自己的难题为什么MySQL是好的,但能够回滚事务是(在我看来)重要以确保您有可用。

回滚可以在开始做一系列交易之前在数据库设置一个保存点,并能要么回滚到原来的状态或提交在结束时候的改变。例如,当记录一次购买,你需要记录一个针对用户的帐户扣款,并输入到shipping表记录,让你知道后来ship的项目。比方说,第二部分失败。你不会要收取用户,但没有ship的项目。因此,你要回滚到事务开始之前的状态。

因此,MySQL不是一个成熟的数据库产品,至少,还不是。它对于世界上90% 的电子商务网仍然是相当好的,但是,4.0版本在撰写本文时最初的版本,解决了这些问题,包括行级锁定和事务控制数量。

把Tomcat和MySQL的结合

Tomcat和MySQL的结合为你用它来学习、开发和部署JSP应用程序提供了一个强大的、可靠的和免费的平台。而且,最好的是,您开发的代码将使用这个平台很好地运行使用iPlanet和Oracle或WebSphere和SQL Server。

作为一个学习工具,两者的结合几乎是“参考实现“他们(JSP和SQL)各自的协议。因此,当你熟悉了解项目的详细情况时,你不会接到任何恶劣的厂商专有的坏习惯。

此外,你可以享受你正在支持开源软件活动的知识。开放源码软件是根据多个公共许可证的编码,往往是GNU通用公共许可证(GPL)的人免费提供。

为什么支持这项活动是很好的?对于这个问题的答案有两点:一个是技术的和一个政治的。从技术上讲,这是一件好事,因为开源软件往往鼓励如JSP和JDBC开放标准的开发,让您从一个更大的群体里去选择你的工具,而不是被锁定成为一个厂商的专有解决方案。从政治上来说这是一个积极的事,因为它保持政治上的大公司的诚实。 WebLogic和iPlanet必须保持竞争力的和响应,因为他们知道,有一个免费的解决方案在那里,如果他们不这样。而当你使用开源软件,你发送一条消息,你的首要问题是他们的特点和可靠性,如果出现错误,没有一个大公司提起诉讼。

原文出处《MySQL and JSP Web applications》作者:James Turner

MySQL and JSP Web applications

JSP developers encounter unique problems when building web applications that require intense database connectivity. MySQL and JSP Web Applications addresses the challenges of building data-driven applications based on the JavaServer Pages development model. MySQL and JSP Web Applications begins with an overview of the core technologies required for JSP database development--JavaServer Pages, JDBC, and the database schema. The book then outlines and presents an Internet commerce application that demonstrates concepts such as receiving and processing user input, designing and implementing business rules, and balancing the user load on the server. Through the JDBC (Java DataBase Connector), the developer can communicate with most commercial databases, such as Oracle. The solutions presented in MySQL and JSP Web Applications center on the open source tools MySQL and Tomcat, allowing the reader an affordable way to test applications and experiment with the book's examples.

So What Is JSP All About?

If you meet the requirements mentioned, you should already have a pretty good idea what the answer to this question is. JSP is all about doing highly object-oriented Web sites that can leverage all the best practices of modern software engineering. These practices include things such as SQL databases and UML-based design. This isn't to say that JSP is a cure-all and that using it will automatically make your Web site a paragon of engineering art. It's just as possible to design bad Web sites in JSP as with any other technology. That's why, as you go through the text, you will see how to incorporate the best practices and how to avoid the pitfalls of convenience when projects get stressful. JSP itself is an evolutionary step along the path that started with the first static Web servers, moved through CGI-enabled servers, and finally the first generation of script-enabled servers. JSP is less a Web server with a Java component than it is a Java engine that understands the Web.

JSP grew out of Java servlets. Servlets allow the developer to handle the incoming Web requests using a Java program that has access to all the normal information that a Common Gateway Interface (CGI) program would. In addition, the servlet has access to session-persistent objects. These are Java objects that are associated with a specific user session and can be used to store state between requests. Servlet programming was a major step forward in allowing developers to write well-structured modular Web applications using an object-oriented language. It also solved the problem of state persistence, allowing more information to reside on the server during a transaction and less to have to pass back and forth between the user and the server. Servlets still suffered from one major problem. Because they eventually need to spit out HTML, the HTML coding had to be embedded in the servlet code. This led to code fragments like the one shown here:

Out.println("\n\nThank you for</p><p>Registering\n");

Out.println("");

This kind of embedding gets very old very fast when you have to code a lot of pages. In addition, having to escape all of the quotation marks can lead to a lot of confusing and hard-to-find errors if you leave out a backslash. Eventually, a still-better idea emerged. Suppose that you could combine the best of static HTML pages and with the interactive capabilities of servlets. The result was JavaServer Pages (on the Microsoft side, the result was Active Server Pages). As Figure I.1 shows, JSP is a complicated beast. In the next chapter, you'll walk through this flow in detail, but for the moment, here are the major steps:

1. A request comes in from a browser using the normal HTTP request format.

2. The Web server hands off the request to JSP. JSP looks at the filename and finds the appropriate JSP file.

3. The .jsp file is converted into a .java file, containing Java code that will create a class whose name is derived from the .jsp filename.

4. JSP then compiles the .java file using javac to produce a .class file. Note that the

two previous steps are skipped if a .class file already exists and is newer than the .jsp file.

5. An instance of the newly created class is instantiated and sent the _jspService message.

6. The new instance looks to see if there is already an instance of the https://www.doczj.com/doc/eb5020648.html,er object called user existing in the session object space for the currently connected user. If not, one is instantiated.

7. As part of servicing stuff.jsp, the user instance is called with the getUserName() method.

8. If the JSP processing requires access to information in a database, it uses JDBC to make the connection and handle the SQL requests.

As you can see, a tremendous amount of power is available in the JSP world. Developers are free to write Web pages that look mostly like HTML, except where callouts to Java are required. But, at the same time, they are free to develop fully fleshed-out object-oriented applications using all the features that Java can bring to bear. They also get all the benefits of servlets, including session persistence.

Why Do We Need Databases?

Well, one reason is so that Larry Ellison of Oracle can afford to keep himself on Prozac when he thinks about Bill Gates. A more serious answer is the same reason that drove man to first press a stick against a piece of wet mud: because it's good to write things down. Web servers are marvelous creatures, but they're a bit like idiot savants. Ask them to serve a Web page or run a piece of Java, and they perform like a champ. But start asking them to remember what they did five minutes ago, and they develop amnesia faster than a character in a soap opera.

The first and most important reason that you use databases is that there's a lot in an e-commerce transaction that you need to remember and track:

?A user's name, address, credit card, and other in formation previously entered on

a registration page

?hat the user might have put into a shopping cart and left from a previous transaction

?What items are in stock, along with their price, description, and so on

?Orders that need to be fulfilled, orders that have been shipped, and items that have been backordered .

Now, you could store all this information in a flat file on the server's hard disk, but there are other important properties that you want to have for this data: ?You want to be able to back out a transaction if part of it fails.

?You want to be able to locate the data somewhere more secure than the Web server, which could be in a DMZ or outside the firewall altogether.

?You want to be able to access data such as user data or products quickl y, even if there are thousands or millions of them.

When you add these items to the shopping list, only a relational database will really do the job effectively.

MySQL

Many sites don't need the battleship strength (and price tag) of Oracle. MySQL is an open-source SQL database available for anyone to use, with many (although not all) of the features of its big brothers, such as Oracle.

MySQL is available for just about any computer that has decent power—it is fairly lightweight on the processor and easy to install (10 minutes, as opposed to multiple hours for Oracle).

So, perhaps you are wondering, what's the catch? What are you not getting in MySQL that makes people turn to Oracle? Well, MySQL is a neat little package, but it is missing some things that would be nice to have in a perfect world.

A major feature that MySQL does not offer is database consistency checking. You can use foreign key tags in your schema, but MySQL cheerfully ignores them. A lot of D

B As I know would consider this a very bad thing.

A foreign key constraint prevents you from creating inconsistent data. For

example, let's suppose that you had a scheme that looked like this:

CREATE TABLE USER (

USERID INTEGER,

FIRST_NAME V ARCHAR(80),

LAST_NAME V ARCHAR(80));

CREATE TABLE PURCHASE (

USERID FOREIGN KEY USER(USERID),

ITEM INTEGER,

QUANTITY INTEGER);

In a database such as Oracle's, if you created an entry in the PURCHASE table with a user ID of 3, there would have to already be a user ID of 3 in the USER table or an error would occur. Similarly, you couldn't delete user 3 from USER if it was referenced in PURCHASE.The MySQL folks make a pretty impassioned argument in their documentation that depending on foreign keys for data integrity is a bad idea anyway, but convincing your DBA of this philosophy is likely to degrade into a religious debate.

In addition, some other features are missing, such as subselects and select into. But probably the other major piece that you will miss is the rollback/commit functionality. MySQL does implement rollback and commit for certain types of tables, but not all of them. Again, the MySQL folks offer their own spin on why this is okay, but being able to roll back transactions is (in my opinion) important enough to make sure that you have it available.

Rollback allows you to set a savepoint on the database before starting to do a series of transactions with it, and be able to either roll back to the original state or commit the changes at the end. For example, when recording a purchase, you need to record a debit against the user's account and enter a record into the shipping table so that you'll know later to ship the item. Let's say that the second part fails. You wouldn't want to charge the user but not ship the item. Thus, you'd want to roll back to the state before the transaction began.

So, MySQL isn't a full-blown production database—at least, not yet. It's still good enough for probably 90% of the e-commerce sites in the world, however. And version 4.0, which is in alpha as of this writing, addresses a number of these concerns,

including row-level locking and transaction control.

Putting Tomcat and MySQL Together

Combining Tomcat and MySQL provides a powerful, reliable, and free platform that you can use to learn, develop, and deploy JSP applications. And, best of all, the code that you develop using this platform will run nicely using iPlanet and Oracle or WebSphere and SQL Server.

As a learning tool the two together are almost "reference implementations" of their respective protocols (JSP and SQL). As a result, you won't pick up any nasty vendor-proprietary bad habits while you're getting up to speed.

In addition, you can enjoy the knowledge that you are supporting the open-source software movement. Open-source software is code that is made freely available under one of several public licenses, frequently the GNU General Public License (GPL).

Why is it good to support this movement? There are two sides to this answer: one technical and one political. Technically, it's a good thing because open-source software tends to encourage the development of open standards such as JSP and JDBC, allowing you to choose your tools from among a larger group rather than being locked into one vendor's proprietary solution. It's a positive thing politically because it keeps the large companies honest. WebLogic and iPlanet have to stay competitive and responsive because they know that there's a free solution out there if they aren't. And when you use open-source software, you are sending a message that your overriding concerns are features and reliability, not having a large company to sue if something goes wrong.

JSP技术简介及特点——外文翻译

JSP Technology Conspectus And Specialties By:Kathy Sierra and Bert Bates Source: Servlet&JSP The JSP (Java Server mix) technology is used by the Sun microsystem issued by the company to develop dynamic Web application technology. With its easy, cross-platform, in many dynamic Web application programming languages, in a short span of a few years, has formed a complete set of standards, and widely used in electronic commerce, etc. In China, the JSP now also got more extensive attention, get a good development, more and more dynamic website to JSP technology. The related technologies of JSP are briefly introduced. The JSP a simple technology can quickly and with the method of generating Web pages. Use the JSP technology Web page can be easily display dynamic content. The JSP technology are designed to make the construction based on Web applications easier and efficient, and these applications and various Web server, application server, the browser and development tools work together. The JSP technology isn't the only dynamic web technology, also not the first one, in the JSP technology existed before the emergence of several excellent dynamic web technology, such as CGI, ASP, etc. With the introduction of these technologies under dynamic web technology, the development and the JSP. Technical JSP the development background and development history In web brief history, from a world wide web that most of the network information static on stock transactions evolution to acquisition of an operation and infrastructure. In a variety of applications, may be used for based on Web client, look no restrictions. Based on the browser client applications than traditional based on client/server applications has several advantages. These benefits include almost no limit client access and extremely simplified application deployment and management (to update an application, management personnel only need to change the program on a server, not thousands of installation in client applications). So, the software industry is rapidly to build on the client browser multi-layer application. The rapid growth of exquisite based Web application requirements development of technical improvements. Static HTML to show relatively static content is right choice, The new challenge is to create the interaction based on Web applications, in these procedures, the

SQL数据库外文翻译--数据库的工作

Working with Databases This chapter describes how to use SQL statements in embedded applications to control databases. There are three database statements that set up and open databases for access: SET DATABASE declares a database handle, associates the handle with an actual database file, and optionally assigns operational parameters for the database. SET NAMES optionally specifies the character set a client application uses for CHAR, VARCHAR, and text Blob data. The server uses this information to transli terate from a database?s default character set to the client?s character set on SELECT operations, and to transliterate from a client application?s character set to the database character set on INSERT and UPDATE operations. g CONNECT opens a database, allocates system resources for it, and optionally assigns operational parameters for the database.All databases must be closed before a program ends. A database can be closed by using DISCONNECT, or by appending the RELEASE option to the final COMMIT or ROLLBACK in a program. Declaring a database Before a database can be opened and used in a program, it must first be declared with SET DATABASE to: CHAPTER 3 WORKING WITH DATABASES. Establish a database handle. Associate the database handle with a database file stored on a local or remote node.A database handle is a unique, abbreviated alias for an actual database name. Database handles are used in subsequent CONNECT, COMMIT RELEASE, and ROLLBACK RELEASE statements to specify which databases they should affect. Except in dynamic SQL (DSQL) applications, database handles can also be used inside transaction blocks to qualify, or differentiate, table names when two or more open databases contain identically named tables. Each database handle must be unique among all variables used in a program. Database handles cannot duplicate host-language reserved words, and cannot be InterBase reserved words.The following statement illustrates a simple database declaration:

JSP技术简介(外文翻译)

JSP技术概述 一、JSP的好处 二、JSP页面最终会转换成servler。因而,从根本上,JSP页面能够执 行的任何任务都可以用servler来完成。然而,这种底层的等同性并不意味着servler和JSP页面对于所有的情况都等同适用。问题不在于技术的能力,而是二者在便利性、生产率和可维护性上的不同。毕竟,在特定平台上能够用Java编程语言完成的事情,同样可以用汇编语言来完成,但是选择哪种语言依旧十分重要。 和单独使用servler相比,JSP提供下述好处: 三、λJSP中HTML的编写与维护更为简单。JSP中可以使用常规的HTML: 没有额外的反斜杠,没有额外的双引号,也没有暗含的Java语法。 四、λ能够使用标准的网站开发工具。即使对那些对JSP一无所知的 HTML工具,我们也可以使用,因为它们会忽略JSP标签(JSP tags)。 五、λ可以对开发团队进行划分。Java程序员可以致力于动态代码。Web 开发人员可以将经理集中在表示层(presentation layer)上。对于大型的项目,这种划分极为重要。依据开发团队的大小,及项目的复杂程度,可以对静态HTML和动态内容进行弱分离(weaker separation)和强分离(stronger separation)。 六、在此,这个讨论并不是让您停止使用servlets,只使用JSP。几乎 所有的项目都会同时用到这两种技术。针对项目中的某些请求,您可能会在MVC构架下组合使用这两项技术。我们总是希望用适当的工具完成相对应的工作,仅仅是servlet并不能填满您的工具箱。 二、JSP相对于竞争技术的优势 许多年前,Marty受到邀请,参加一个有关软件技术的小型(20个人)研讨会.做在Marty旁边的人是James Gosling--- Java编程语言的发明者。 隔几个位置,是来自华盛顿一家大型软件公司的高级经理。在讨论过程中,研讨会的主席提出了Jini的议题,这在当时是一项新的Java技术.主席向该经理询问他的想法.他继续说,他们会持续关注这项技术,如果这

数据库外文参考文献及翻译.

数据库外文参考文献及翻译 数据库外文参考文献及翻译数据库管理系统——实施数据完整性一个数据库,只有用户对它特别有信心的时候。这就是为什么服务器必须实施数据完整性规则和商业政策的原因。执行SQL Server的数据完整性的数据库本身,保证了复杂的业务政策得以遵循,以及强制性数据元素之间的关系得到遵守。因为SQL Server的客户机/服务器体系结构允许你使用各种不同的前端应用程序去操纵和从服务器上呈现同样的数据,这把一切必要的完整性约束,安全权限,业务规则编码成每个应用,是非常繁琐的。如果企业的所有政策都在前端应用程序中被编码,那么各种应用程序都将随着每一次业务的政策的改变而改变。即使您试图把业务规则编码为每个客户端应用程序,其应用程序失常的危险性也将依然存在。大多数应用程序都是不能完全信任的,只有当服务器可以作为最后仲裁者,并且服务器不能为一个很差的书面或恶意程序去破坏其完整性而提供一个后门。SQL Server使用了先进的数据完整性功能,如存储过程,声明引用完整性(DRI),数据类型,限制,规则,默认和触发器来执行数据的完整性。所有这些功能在数据库里都有各自的用途;通过这些完整性功能的结合,可以实现您的数据库的灵活性和易于管理,而且还安全。声明数据完整性声明数据完整原文请找腾讯3249114六,维-论'文.网 https://www.doczj.com/doc/eb5020648.html, 定义一个表时指定构成的主键的列。这就是所谓的主键约束。SQL Server使用主键约束以保证所有值的唯一性在指定的列从未侵犯。通过确保这个表有一个主键来实现这个表的实体完整性。有时,在一个表中一个以上的列(或列的组合)可以唯一标志一行,例如,雇员表可能有员工编号( emp_id )列和社会安全号码( soc_sec_num )列,两者的值都被认为是唯一的。这种列经常被称为替代键或候选键。这些项也必须是唯一的。虽然一个表只能有一个主键,但是它可以有多个候选键。 SQL Server的支持多个候选键概念进入唯一性约束。当一列或列的组合被声明是唯一的, SQL Server 会阻止任何行因为违反这个唯一性而进行的添加或更新操作。在没有故指的或者合适的键存在时,指定一个任意的唯一的数字作为主键,往往是最有效的。例如,企业普遍使用的客户号码或账户号码作为唯一识别码或主键。通过允许一个表中的一个列拥有身份属性,SQL Server可以更容易有效地产生唯一数字。您使用的身份属性可以确保每个列中的值是唯一的,并且值将从你指定的起点开始,以你指定的数量进行递增(或递减)。(拥有特定属性的列通常也有一个主键或唯一约束,但这不是必需的。)第二种类型的数据完整性是参照完整性。 SQL Server实现了表和外键约束之间的逻辑关系。外键是一个表中的列或列的组合,连接着另一个表的主键(或着也可能是替代键)。这两个表之间的逻辑关系是关系模型的基础;参照完整性意味着这种关系是从来没有被违反的。例如,一个包括出版商表和标题表的简单的select例子。在标题表中,列title_id (标题编号)是主键。在出版商表,列pub_id (出版者ID )是主键。 titles表还包括一个pub_id列,这不是主键,因为出版商可以发布多个标题。相反, pub_id是一个外键,它对应着出版商表的主键。如果你在定义表的时候声明了这个关系, SQL Server由双方执行它。首先,它确保标题不能进入titles表,或在titles表中现有的pub_id无法被修改,除非有效的出版商ID作为新pub_id出现在出版商表中。其次,它确保在不考虑titles表中对应值的情况下,出版商表中的pub_id的值不做任何改变。以下两种方法可

数据库设计外文翻译

外文翻译: 索引 原文来源:Thomas Kyte.Expert Oracle Database Architecture .2nd Edition. 译文正文: 什么情况下使用B*树索引? 我并不盲目地相信“法则”(任何法则都有例外),对于什么时候该用B*索引,我没有经验可以告诉你。为了证明为什么这个方面我无法提供任何经验,下面给出两种等效作法:?使用B*树索引,如果你想通过索引的方式去获得表中所占比例很小的那些行。 ?使用B *树索引,如果你要处理的表和索引许多可以代替表中使用的行。 这些规则似乎提供相互矛盾的意见,但在现实中,他们不是这样的,他们只是涉及两个极为不同的情况。有两种方式使用上述意见给予索引: ?作为获取表中某些行的手段。你将读取索引去获得表中的某一行。在这里你想获得表中所占比例很小的行。 ?作为获取查询结果的手段。这个索引包含足够信息来回复整个查询,我们将不用去查询全表。这个索引将作为该表的一个瘦版本。 还有其他方式—例如,我们使用索引去检索表的所有行,包括那些没有建索引的列。这似乎违背了刚提出的两个规则。这种方式获得将是一个真正的交互式应用程序。该应用中,其中你将获取其中的某些行,并展示它们,等等。你想获取的是针对初始响应时间的查询优化,而不是针对整个查询吞吐量的。 在第一种情况(也就是你想通过索引获得表中一小部分的行)预示着如果你有一个表T (使用与早些时候使用过的相一致的表T),然后你获得一个像这样查询的执行计划: ops$tkyte%ORA11GR2> set autotrace traceonly explain ops$tkyte%ORA11GR2> select owner, status 2 from t 3 where owner = USER; Execution Plan ---------------------------------------------------------- Plan hash value: 1049179052 ------------------------------------------------------------------ | Id | Operation | Name | Rows | Bytes | ------------------------------------------------------------------ | 0 | SELECT STATEMENT | | 2120 | 23320 | | 1 | TABLE ACCESS BY INDEX ROWID |T | 2120 | 23320 | | *2 | INDEX RANGE SCAN | DESC_T_IDX | 8 | | ------------------------------------------------------------------ Predicate Information (identified by operation id): --------------------------------------------------- 2 - access(SYS_OP_DESCEND("OWNER")=SYS_OP_DESCEND(USER@!)) filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("OWNER"))=USER@!) 你应该访问到该表的一小部分。这个问题在这里看是INDEX (RANGE SCAN) 紧跟在

外文文献及翻译----Servlet和JSP技术简述

毕业设计(论文) 外文文献翻译 专业 学生姓名 班级 学号 指导教师 XX 学院

外文资料名称:An Overview of Servlet and JSP Technology 外文资料出处:Internet 附件: 1.外文资料翻译译文 2.外文原文 指导教师评语: 签名: 年月日

Servlet和JSP技术简述 Nagle and Wiegley XX译 摘要:Servlet程序在服务器端运行,动态地生成Web页面与传统的CGI和许多其他类似CGI的技术相比,Java Servlet具有更高的效率,更容易使用,功能更强大,具有更好的可移植性,更节省投资。 关键字:JSP技术,Servlet,HTTP服务 1.1Servlet的功能 Servlets是运行在Web或应用服务器上的Java程序,它是一个中间层,负责连接来自Web浏览器或其他HTTP客户程序的请求和HTTP服务器上的数据库或应用程序。Servlet的工作是执行西门的任务,如图1.1所示。 图1.1Web中间件的作用 (1)读取客户发送的显式数据。 最终用户一般在页面的HTML表单中输入这些数据。然而,数据还有可能来自applet或定制的HTTP客户程序。 (2)读取由浏览器发送的隐式请求数据。 图1.1中显示了一条从客户端到Web服务器的单箭头,但实际上从客户端传送到Web服务器的数据有两种,它们分别为用户在表单中输入的显式数据,以及后台的HTTP信息。两种数据都很重要。HTTP信息包括cookie、浏览器所能识别的媒体类型和压缩模式等。 (3)生成结果。 这个过程可能需要访问数据库、执行RMI或EJB调用、调用Web服务,或者直接计算得出对应的响应。实际的数据可能存储在关系型数据库中。该数据库可能不理解HTTP,或者不能返回HTML形式的结果,所有Web浏览器不能直接与数据库进行会话。即使它能够做到这一点,为了安全上的考虑,我们也不希望让它这么做。对应大多数

大学毕业设计仓库管理系统数据库计算机外文参考文献原文及翻译

河北工程大学毕业论文(设计)英文参考文献原文复印件及译文 数据仓库 数据仓库为商务运作提供结构与工具,以便系统地组织、理解和使用数据进行决策。大量组织机构已经发现,在当今这个充满竞争、快速发展的世界,数据仓库是一个有价值的工具。在过去的几年中,许多公司已花费数百万美元,建立企业范围的数据仓库。许多人感到,随着工业竞争的加剧,数据仓库成了必备的最新营销武器——通过更多地了解客户需求而保住客户的途 径。“那么”,你可能会充满神秘地问,“到底什么是数据仓库?” 数据仓库已被多种方式定义,使得很难严格地定义它。宽松地讲,数据仓库是一个数据库,它与组织机构的操作数据库分别维护。数据仓库系统允许将各种应用系统集成在一起,为统一的历史数据分析提供坚实的平台,对信息处理提供支持。 按照W. H. Inmon,一位数据仓库系统构造方面的领头建筑师的说法,“数 (1) 视图。 (2)

般文件和联机事务处理记录,集成在一起。使用数据清理和数据集成技术,确保命名约定、编码结构、属性度量的一致性等。 (3)时变的:数据存储从历史的角度(例如,过去5-10 年)提供信息。数据仓库中的关键结构,隐式或显式地包含时间元素。 (4) 非易失的:数据仓库总是物理地分离存放数据;这些数据源于操作环境下的应用数据。由于这种分离,数据仓库不需要事务处理、恢复和并行控制机制。通常,它只需要两种数据访问:数据的初始化装入和数据访问。 概言之,数据仓库是一种语义上一致的数据存储,它充当决策支持数据模型的物理实现,并存放企业决策所需信息。数据仓库也常常被看作一种体系结构,通过将异种数据源中的数据集成在一起而构造,支持结构化和启发式查询、分析报告和决策制定。 “好”,你现在问,“那么,什么是建立数据仓库?” 根据上面的讨论,我们把建立数据仓库看作构造和使用数据仓库的过程。数据仓库的构造需要数据集成、数据清理、和数据统一。利用数据仓库常常需要一些决策支持技术。这使得“知识工人”(例如,经理、分析人员和主管)能够使用数据仓库,快捷、方便地得到数据的总体视图,根据数据仓库中的信息做出准确的决策。有些作者使用术语“建立数据仓库”表示构造数据仓库的过程,而用术语“仓库DBMS”表示管理和使用数据仓库。我们将不区分二者。 “组织机构如何使用数据仓库中的信息?”许多组织机构正在使用这些信息支持商务决策活动,包括: (1)、增加顾客关注,包括分析顾客购买模式(如,喜爱买什么、购买时间、预算周期、消费习惯); (2)、根据季度、年、地区的营销情况比较,重新配置产品和管理投资,调整生产策略; (3)、分析运作和查找利润源; (4)、管理顾客关系、进行环境调整、管理合股人的资产开销。 从异种数据库集成的角度看,数据仓库也是十分有用的。许多组织收集了形形色色数据,并由多个异种的、自治的、分布的数据源维护大型数据库。集成这些数据,并提供简便、有效的访问是非常希望的,并且也是一种挑战。数据库工业界和研究界都正朝着实现这一目标竭尽全力。 对于异种数据库的集成,传统的数据库做法是:在多个异种数据库上,建立一个包装程序和一个集成程序(或仲裁程序)。这方面的例子包括IBM 的数据连接程序和Informix的数据刀。当一个查询提交客户站点,首先使用元数据字典对查询进行转换,将它转换成相应异种站点上的查询。然后,将这些查询

jsp介绍外文翻译

外文原文 JSP JSP (JavaServer Pages) is initiated by Sun Microsystems, Inc., with many companies to participate in the establishment of a dynamic web page technical standards. JSP technology somewhat similar to ASP technology, it is in the traditional HTML web page document (*. htm, *. html) to insert the Java programming paragraph (Scriptlet) and JSP tag (tag), thus JSP documents (*. jsp). Using JSP development of the Web application is cross-platform that can run on Linux, is also available for other operating systems. JSP technology to use the Java programming language prepared by the category of XML tags and scriptlets, to produce dynamic pages package processing logic. Page also visit by tags and scriptlets exist in the services side of the resources of logic. JSP page logic and web page design and display separation, support reusable component-based design, Web-based application development is rapid and easy. Web server in the face of visits JSP page request, the first implementation of the procedures of, and then together with the results of the implementation of JSP documents in HTML code with the return to the customer. Insert the Java programming operation of the database can be re-oriented websites, in order to achieve the establishment of dynamic pages needed to function. JSP and Java Servlet, is in the implementation of the server, usually returned to the client is an HTML text, as long as the client browser will be able to visit. JSP 1.0 specification of the final version is launched in September 1999, December has introduced 1.1 specifications. At present relatively new is JSP1.2 norms, JSP2.0 norms of the draft has also been introduced. JSP pages from HTML code and Java code embedded in one of the components. The server was in the pages of client requests after the Java code and then will generate the HTML pages to return to the client browser. Java Servlet JSP is the technical foundation and large-scale Web application development needs of Java Servlet and JSP support to complete. JSP with the Java technology easy to use, fully object-oriented, and a platform-independent and secure, mainly for all the characteristics of the Internet. JavaScript, which is completely distinct from the Java programming language, is normally used to dynamically generate HTML on the client, building parts of the Web

外文文献之数据库信息管理系统简介

Introduction to database information management system The database is stored together a collection of the relevant data, the data is structured, non-harmful or unnecessary redundancy, and for a variety of application services, data storage independent of the use of its procedures; insert new data on the database , revised, and the original data can be retrieved by a common and can be controlled manner. When a system in the structure of a number of entirely separate from the database, the system includes a "database collection." Database management system (database management system) is a manipulation and large-scale database management software is being used to set up, use and maintenance of the database, or dbms. Its unified database management and control so as to ensure database security and integrity. Dbms users access data in the database, the database administrator through dbms database maintenance work. It provides a variety of functions, allows multiple applications and users use different methods at the same time or different time to build, modify, and asked whether the database. It allows users to easily manipulate data definition and maintenance of data security and integrity, as well as the multi-user concurrency control and the restoration of the database. Using the database can bring many benefits: such as reducing data redundancy, thus saving the data storage space; to achieve full sharing of data resources, and so on. In addition, the database technology also provides users with a very simple means to enable users to easily use the preparation of the database applications. Especially in recent years introduced micro-computer relational database management system dBASELL, intuitive operation, the use of flexible, convenient programming environment to extensive (generally 16 machine, such as IBM / PC / XT, China Great Wall 0520, and other species can run software), data-processing capacity strong. Database in our country are being more and more widely used, will be a powerful tool of economic management. The database is through the database management system (DBMS-DATA BASE MANAGEMENT SYSTEM) software for data storage, management and use of dBASELL is a database management system software. Information management system is the use of data acquisition and transmission technology, computer network technology, database construction, multimedia

数据库管理外文翻译

数据库管理 数据库(有时拼成Database)也称为电子数据库,是指由计算机特别组织的用下快速查找和检索的任意的数据或信息集合。数据库与其它数据处理操作协同工作,其结构要有助于数据的存储、检索、修改和删除。数据库可存储在磁盘或磁带、光盘或某些辅助存储设备上。 一个数据库由一个文件或文件集合组成。这些文件中的信息可分解成一个个记录,每个记录有一个或多个域。域是数据库存储的基本单位,每个域一般含有由数据库描述的属于实体的一个方面或一个特性的信息。用户使用键盘和各种排序命令,能够快速查找、重排、分组并在查找的许多记录中选择相应的域,建立特定集上的报表。 数据库记录和文件的组织必须确保能对信息进行检索。早期的系统是顺序组织的(如:字母顺序、数字顺序或时间顺序);直接访问存储设备的研制成功使得通过索引随机访问数据成为可能。用户检索数据库信息的主要方法是query(查询)。通常情况下,用户提供一个字符串,计算机在数据库中寻找相应的字符序列,并且给出字符串在何处出现。比如,用户必须能在任意给定时间快速处理内部数据。而且,大型企业和其它组织倾向于建立许多独立的文件,其中包含相互关联的甚至重叠的数据,这些数据、处理活动经常需要和其它文件的数据相连。为满足这些要求,开发邮各种不同类型的数据库管理系统,如:非结构化的数据库、层次型数据库、网络型数据库、关系型数据库、面向对象型数据库。 在非结构化的数据库中,按照实体的一个简单列表组织记录;很多个人计算机的简易数据库是非结构的。层次型数据库按树型组织记录,每一层的记录分解成更小的属性集。层次型数据库在不同层的记录集之间提供一个单一链接。与此不同,网络型数据库在不同记录集之间提供多个链接,这是通过设置指向其它记录集的链或指针来实现的。网络型数据库的速度及多样性使其在企业中得到广泛应用。当文件或记录间的关系不能用链表达时,使用关系型数据库。一个表或一个“关系”,就是一个简单的非结构列表。多个关系可通过数学关系提供所需信息。面向对象的数据库存储并处理更复杂的称为对象的数据结构,可组织成有层次的类,其中的每个类可以继承层次链中更高一级类的特性,这种数据库结构最灵活,最具适应性。 很多数据库包含自然语言文本信息,可由个人在家中使用。小型及稍大的数据库在商业领域中占有越来越重要的地位。典型的商业应用包括航班预订、产品管理、医院的医疗记录以及保险公司的合法记录。最大型的数据库通常用天政府部门、企业、大专院校等。这些数据库存有诸如摘要、报表、成文的法规、通讯录、报纸、杂志、百科全书、各式目录等资料。索引数据库包含参考书目或用于

毕业设计JSP MVC外文翻译

Struts——一种开源MVC的实现 这篇文章介绍Struts,一个使用servlet和JavaServer Pages技术的一种Model-View-Controller的实现。Struts可以帮助你控制Web项目中的变化并提高专业化。即使你可能永远不会用Struts实现一个系统,你可以获得一些想法用于你未来的servlet和JSP网页的实现中。 简介 在小学校园里的小孩子们都可以在因特网上发布HTML网页。然而,有一个重大的不同在一个小学生和一个专业人士开发的网站之间。网页设计师(或者HTML开发人员)必须理解颜色、用户、生产流程、网页布局、浏览器兼容性、图像创建、JavaScript等等。设计漂亮的网站需要做大量的工作,大多数Java开发人员更注重创建优美的对象接口,而不是用户界面。JavaServer Pages(JSP)技术为网页设计人员和Java开发人员提供了一种联系钮带。 如果你开发过大型Web应用程序,你就理解“变化”这个词语。“模型-视图-控制器”(MVC)就是用来帮助你控制变化的一种设计模式。MVC减弱了业务逻辑接口和数据接口之间的耦合。Struts是一种MVC实现,它将Servlet2.2和JSP 1.1标记(属于J2EE规范)用作实现的一部分。你可能永远不会用Struts实现一个系统,但了解一下Struts或许使你能将其中的一些思想用于你以后的Servlet和JSP实现中。 模型-视图-控制器(MVC) JSP标签只解决了我们问题中的一部分。我们依然有验证、流控制、以及更新应用程序结构的问题。这就是MVC从哪儿来以及来干嘛的。MVC通过把问题分成三类来帮助解决一些与单模块相关的问题: ?Model(模型) 模块包括应用程序功能的核心。模型封装着应用程序的各个结构。有时它所包含的唯一功能就是结构。它对于视图或者控制器一无所知。 ?View(视图) 视图提供了模型的演示。它是应用程序的外表。视图可以进入模型获得者,

数据库中英文对照外文翻译文献

中英文对照外文翻译 Database Management Systems A database (sometimes spelled data base) is also called an electronic database , referring to any collection of data, or information, that is specially organized for rapid search and retrieval by a computer. Databases are structured to facilitate the storage, retrieval , modification, and deletion of data in conjunction with various data-processing operations .Databases can be stored on magnetic disk or tape, optical disk, or some other secondary storage device. A database consists of a file or a set of files. The information in these files may be broken down into records, each of which consists of one or more fields. Fields are the basic units of data storage , and each field typically contains information pertaining to one aspect or attribute of the entity described by the database . Using keywords and various sorting commands, users can rapidly search , rearrange, group, and select the fields in many records to retrieve or create reports on particular aggregate of data. Complex data relationships and linkages may be found in all but the simplest databases .The system software package that handles the difficult tasks associated with creating ,accessing, and maintaining database records is called a database management system(DBMS).The programs in a DBMS package establish an interface between the database itself and the users of the database.. (These users may be applications programmers, managers and others with information needs, and various OS programs.) A DBMS can organize, process, and present selected data elements form the database. This capability enables decision makers to search, probe, and query database contents in order to extract answers to nonrecurring and unplanned questions that aren’t available in regular reports. These questions might initially be vague and/or poorly defined ,but people can “browse” through the database until they have the needed information. In short, the DBMS will “manage” the stored data items and assemble the needed items from the common database in response to the queries of those who aren’t programmers. A database management system (DBMS) is composed of three major parts:(1)a storage subsystem

相关主题
文本预览
相关文档 最新文档