简体   繁体   English

MySql Connector J JDBC驱动程序不支持连接池吗?

[英]Do MySql Connector J JDBC drivers not support connection pooling?

Does Connector J really not support connection pooling. 连接器J确实不支持连接池吗? Looking at their documentation I have to download a 3rd party library such as DBCP or c3p0 to get this right. 查看他们的文档,我必须下载一个第三方库,例如DBCP或c3p0才能正确使用。 What is the motivation for not introducing it in the Connector J driver itself? 不将其引入Connector J驱动程序本身的动机是什么? Is this something that the J2EE spec dictates? 这是J2EE规范规定的吗?

No JDBC driver that I know of (Oracle, SQL Server, MySQL, PostgreSQL) supports connection pooling on its own. 据我所知,没有JDBC驱动程序(Oracle,SQL Server,MySQL,PostgreSQL)独自支持连接池。 That's usually a service provided by a Java EE app server. 通常,这是Java EE应用服务器提供的服务。

I don't blame you for being confused - that's how I feel when I stray into .NET territory. 我不怪您感到困惑-这就是我误入.NET领域的感觉。

I believe the reason is historical: pooling and naming are services that a CORBA ORB provided for distributed objects. 我相信原因是历史性的:池化和命名是CORBA ORB为分布式对象提供的服务。 When enterprise Java was conceived, the idea was to create a transaction monitor for distributed objects that encapsulated those services. 构想企业Java时,其想法是为封装这些服务的分布式对象创建事务监视器。 All the difficulties of pooling, object lifecycle, threading, etc. were moved out of the application and into the application server on which they were housed. 池,对象生命周期,线程等的所有困难都已从应用程序移出,并移到它们所在的应用程序服务器中。 Enterprise Java Beans were supposed to allow users to concentrate on the objects that expressed business logic and leave all that house-keeping stuff to the app server. 企业Java Bean应该允许用户专注于表达业务逻辑的对象,并将所有整理工作留给应用程序服务器。 A market for app servers was born: WebLogic, WebSphere, JBOSS, etc. 应用服务器市场诞生了:WebLogic,WebSphere,JBOSS等。

As I understand .NET, there's just one app server: IIS. 据我了解。NET,只有一个应用程序服务器:IIS。 I don't know how .NET handles connection pooling, but IIS history started as a web server analog to Apache. 我不知道.NET如何处理连接池,但是IIS历史开始于与Apache类似的Web服务器。 I don't think it started in the same place. 我认为它不是从同一个地方开始的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM