读书人

施用BoneCP数据库连接池JAVA版本

发布时间: 2012-08-07 14:54:48 作者: rapoo

使用BoneCP数据库连接池JAVA版本

?

BoneCP is a fast, free, open-source, Java database connection pool (JDBC Pool) library. If you are familiar with C3P0 and DBCP then you already know what this means. For the rest, this is a library that will manage a database connection for you to get faster database access in your application.
BoneCP is fast! For some tests, it's almost 25 times faster than the next fastest connection pool option, not to mention that BoneCP never spin-locks so it won't slow down your application.
官方主页:http://jolbox.com/
下载地址:http://jolbox.com/bonecp/downloads/maven/com/jolbox/bonecp/
目前最新版本为:0.7
依赖的jar包:

A database that accepts connectionsA driver to go with itGoogle Guava library, available for free from?here.The?SLF4J?logging library.JDK1.5 or higher.


bonecp-0.7.0.jar
google-collections-1.0.jar
log4j-1.2.15.jar
mysql-connector-java-5.1.6-bin.jar(mysql驱动)
slf4j-api-1.5.10.jar
slf4j-log4j12-1.5.10.jar
以上jar包可以在这里下载http://jolbox.com/bonecp/downloads/maven/

?

?

在jdbc中使用BoneCP连接池

?

?

?

?

?

xml方式配置bonecp

?

?

?连接代码

?

?

?

使用DataSource

?

?

?

在Hibernate中使用BoneCP

在Hibernate中使用BoneCP除了需要上面提到的jar包之外,还需要下载一个名为bonecp-provider-0.7.0.jar的bonecp-provider的jar包,它的下载位置是:http://jolbox.com/bonecp/downloads/maven/com/jolbox/bonecp-provider/0.7.0/bonecp-provider-0.7.0.jar。

除此之外,还需要做如下配置:

?

?

?

?

参考:http://www.blogjava.net/sxyx2008/archive/2011/03/16/346384.html

读书人网 >其他数据库

热点推荐