数据库连接池(汉译英)

来源:互联网 发布:查询表数据的sql语句 编辑:程序博客网 时间:2024/05/17 22:47
虽然软件编程是我的本行,但要把极短的时间内,把技术文献翻译成英文,对我来说也的确是一项小小的挑战。以下是一篇关于数据库连接文章的片断:
在没有出现数据库连接池该项技术的时候,人们大多通过JDBC获得数据库的连接,在用完一次连接的时候就会关闭本次连接。对于一个只是几次使用数据库连接的系统来说,可能这样就可以满足人们对性能的要求了,但当多次请求数据库连接的时候,这样频繁的连接/关闭数据库,会使得系统负担过重。毕竟连接一次数据库是很消耗系统资源,而轻易的断掉一次连接又是那么可惜。为了解决这个问题,数据库连接池诞生了。数据库连接池加快了数据库的访问速度,在WEB开发中可以使用第三方提供的连接池包,也可以使用WEB服务器自带的数据库连接池,如Tomcat。
Before the technology of database connection pool was born, database connections were
obtained mostly by JDBC. When a connection was not used any more, it would be closed.
It is enough to meet users’ demands for a system in which the database is used only
several times. However, for a system of multi-request for database connections it would be
a heavy burden to the system if the connection was frequently opened and closed. After all
a database connection is a resource-consuming job, it is pity to close it so easily. To
solve this problem the database connection pool was born. The database connection
pool speeds up the database access. In the process of the web development we can
use connection pool packages offered by a third party, or use the database connection
pool that is available by the web server, such as Tomcat.
在这里我介绍一下Tomcat自带的数据库连接池。Tomcat的数据库连接池是通过配置server.xml文件来获得的,Tomcat在启动的时候,加载server.xml文件中的信息,通过连接池的配置信息,Tomcat在启动的同时,初始化了指定数量的数据库连接,放到内存中,这就是我们说的数据库连接池。要用到数据库连接的时候,只要从数据库连接池中获得一个连接,用完的时候,就放回到数据库连接池中,准备被别的请求再次调用。这种机制减少了数据库的连接和关闭的次数,也正是这样才提高了效率。

Now let me briefly introduce the database connection pool bound with Tomcat. The

database connection pool of Tomcat can be obtained by the configuring file

server.xml. When Tomcat starts up, the information in this file is automatically

loaded. According to the configuring information a certain quantity of database

connections were initialized and put into RAM. This is what we mean the database

connection pool. When a database connection is needed, it can be obtained from the

database connection pool. When the usage is finished, the connection is put back

into the pool preparing for the next request. This mechanism reduces the times of

database opening up and closing down; as the result, the efficiency is raised.

原创粉丝点击