Java JDBC connection pool library choice in 2011/2012?

落爺英雄遲暮 提交于 2019-11-26 07:56:00

问题


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.


回答1:


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.




回答2:


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.




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/5640146/java-jdbc-connection-pool-library-choice-in-2011-2012

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!