数据库连接池(汉译英)

本文简要介绍了与Tomcat绑定的数据库连接池。通过配置文件server.xml,Tomcat启动时会自动加载其中的信息,根据配置初始化一定数量的数据库连接并放入内存中,即数据库连接池。当需要数据库连接时,可以从池中获取,使用完毕后再放回池中,以备下次请求。这种机制减少了数据库的打开和关闭次数,从而提高了效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

虽然软件编程是我的本行,但要把极短的时间内,把技术文献翻译成英文,对我来说也的确是一项小小的挑战。以下是一篇关于数据库连接文章的片断:
在没有出现数据库连接池该项技术的时候,人们大多通过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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值