2011/2012年Java JDBC连接池库选择?
我应该为新的应用程序项目(而不是 Web 应用程序)使用哪个 JDBC 连接池库?
- Apache DBCP 有 有足够多的未解决问题,我认为这些问题会被推到 2.0。
- C3P0 开发似乎已停止。
- 而且它们看起来都相对较慢。
- Proxool 已经死了。
- DBPool 几乎没有社区(至少我没有发现公共社区 - 没有论坛,没有邮件列表...... )
- Apache Tomcat Pool 看起来在没有 Tomcat 的情况下无法使用,
- 我发现Oracle 网站上的 SQL 数据源 文章,但它似乎只能应用于运行的小程序在 Servlet 和 Web 服务等容器中。
我应该选择BoneCP吗?我没有什么太大的要求。我只需要一个良好且易于使用的数据库连接池,它正在积极开发中。库,其作者可以回复错误报告、回答一些具体问题等。
顺便说一句,实际上,我只使用 MySQL。我发现 MySQL 驱动程序 支持 DriverManager 接口,但我不确定它是否真的池化连接。
Which JDBC connection pool library should I use for a new application project (not web application)?
- Apache DBCP has enough unresolved issues which are pushed until 2.0 I think.
- C3P0 development seems to be stopped.
- And both of them looks relatively slow.
- Proxool is dead.
- DBPool has almost no community (at least I've found no public one - no forums, no mailing lists...)
- Apache Tomcat Pool looks to be unusable without Tomcat
- I've found SQL Datasources article at Oracle website, but it seems, that it can be applied only to applets running in containers like servlets and web services.
Should I choose BoneCP may be? I don't have any huge requirements. I just need a good and easy to use database connection pool, that is in active development. Library, whose author can respond to bug reports, answer some specific question etc.
BTW, actually, I'm using MySQL only. I've found, that MySQL driver supports DriverManager interface, but I'm unsure if it actually pools connections or not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
你已经做了很好的研究。我想说,继续使用 BoneCP。几年前,我会建议使用 c3p0,但它目前有一些未解决的未解决问题< /a> 也是如此。事实上,太糟糕了。顺便说一下,BoneCP 作者也活跃在 SO 这里。
You've done good research. I'd say, go ahead with BoneCP. Some years ago I would have suggested c3p0, but it has currently some open and unresolved issues as well. Too bad, actually. The BoneCP author is by the way also active here at SO.
可以在没有 Tomcat 的情况下使用 Tomcat 连接池,它只是几个可以包含到任何软件中的 .jar。我已成功将 Tomcat 连接池与 Resin 和 Jetty 应用程序服务器。
It is possible use Tomcat Connection Pool without Tomcat, it is just a couple of .jars that you can include to any software. I have successfully used Tomcat Connection Pool with Resin and Jetty application servers.
另一种选择是 Vibur DBCP。这是一个基于 Java 动态代理的新型并发 JDBC 连接池。它速度快,源代码简洁,支持公平参数、JDBC 语句缓存、长时间运行的 SQL 查询日志记录以及许多其他功能。
Vibur DBCP 在中央 Maven 存储库中可用,该网站显示了所需的 Maven 依赖项、各种配置示例(使用 Spring、Hibernate 3.x/4.x/5.x)以及所有配置选项。
Vibur DBCP 需要 Java 1.7。
免责声明:我是 Vibur DBCP 的作者。
Another alternative is Vibur DBCP. This is a new, concurrent JDBC connection pool based on Java dynamic proxies. It is fast, has concise source code, supports fairness parameter, JDBC Statement caching, long running SQL queries logging, and many other features.
Vibur DBCP is available in the central Maven repo, the website shows the needed Maven dependency, various configuration examples (with Spring, Hibernate 3.x/4.x/5.x), and all configuration options.
Vibur DBCP requires Java 1.7.
Disclaimer: I'm the author of Vibur DBCP.
我知道现在回答已经太晚了,但我刚刚发现了一个有趣的链接,其中给出了更广泛的范围来回答您的大多数疑问。但最终 HikariCP 和 BoneCP 比其他选项要好得多。
I know its too late for answer but I just found an interesting link which has given a broader scope to answer most your queries. But at the end HikariCP and BoneCP are much better than other options.