连接和语句池的好处是什么? [英] What is the benefit of Connection and Statement Pooling?

查看:195
本文介绍了连接和语句池的好处是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释什么是Connection和Statement Pooling,以及对未解压数据源的好处是什么?我试图理解什么时候在项目中使用像c3p0或proxool这样的技术是个好主意。我需要先了解他们做什么,什么时候有趣的使用它们。非常感谢。

Can someone explain what is Connection and Statement Pooling and what is the benefit over unpooled DataSources? I am trying to understand when it is a good idea to use a technology like c3p0 or proxool in a project. I need first to understand what they do and when it interesting to use them. Thank you very much.

推荐答案

快乐连接



容易创建一个新的连接每次。 一行:就是这样。没什么可想的。伟大的生活。

The Happy Connection

It's so easy to create a new connection every time. One line: that's all it takes. Nothing much to think about. Great life.

每次使用后,你会丢弃你的盘子吗?

Do you throw away your plate after each use?

不,你洗它,在菜架上,所以你可以再次使用它在你的下一顿饭。每次买新板都是不可能的。

No, you wash it and put it on the dish rack, so you can use it again on your next meal. Buying new plates everytime is out of the question. If you did that, you will have wasted enough money to buy a new iPad in one year.

再次考虑连接池。

但这一次,连接是你的盘子,连接池是你的菜架。您的钱包和您的能量代表系统资源(记忆和带宽)。

But this time, the connections are your plates, the connection pool is your dish rack. Your wallet and your energy represent the system resources (memory and bandwidth).

你宁愿做:

a。洗碗。

b。

虽然连接池中涉及到任务,但与长期创建新连接相比,它的收费要少一些。关键在于知道你的家人(应用程序)在任何一天需要多少板(连接)。

While there are tasks involved in connection pooling, it's less taxing in the long run compared to creating new connections every time. The key is in knowing how many plates (connections) your family (application) will need in any given day.

池可用于数据库连接,线程,实体bean和其他工厂派生对象。

Pools can be used for database connections, threads, entity beans and other factory-derived objects.

这篇关于连接和语句池的好处是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆