Skip to content
High Performance JDBC Connection Pool(faster than HikariCP : 比光连接池更快)
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
doc Add files via upload Apr 1, 2020
lib Add files via upload Nov 29, 2019
src Add files via upload Apr 1, 2020 Update Apr 1, 2020 Update Apr 1, 2020
pom.xml Update pom.xml Apr 1, 2020



BeeCP is a high performance JDBC connection pool



1: Good performance: faster than HikariCP

2: Less code: 21 files, 2600 lines of source code


The performance of each connection pool is tested by multi-threaded query (1000 threads execute 1000 times each, totally 1 million times), and the time-consuming distribution and average time-consuming are printed. Finally, the connection pools are ranked according to the usual time-consuming. Single time statistics (machine status impact on the test results):


1:Below are the test results of each connection pool at Mysql5.6 (milliseconds)

Bee_C(5.3623) > Bee_F(6.8492) > HikariCP(9.0176)


project for performance test code,please visit:

2:Test with HikariCP benchmark(I3-7100,8G)




public class DataSourceConfig {
  private String driver;
  private String url;
  private String user;
  private String password;
  private String datasourceJndiName;
  private BeeDataSourceFactory dataSourceFactory = new BeeDataSourceFactory();
  public DataSource primaryDataSource() {
    return DataSourceBuilder.create().type(cn.beecp.BeeDataSource.class).build();
  public DataSource secondDataSource(){
    return new BeeDataSource(new BeeDataSourceConfig(driver,url,user,password));
  public DataSource thirdDataSource()throws SQLException {
       return dataSourceFactory.lookup(datasourceJndiName);
     }catch(NamingException e){
       throw new SQLException("Jndi DataSource not found:"+datasourceJndiName);

Maven download





Friendly tips: the latest version is recommended

Function List

1: Request timeout support

2: Two modes: fairness and competition

3: Pool recreate new connections when network restore

4: Idle timeout and holding timeout

5: Preparedstatement cache support (optional)

6: Before connection recovery, things can be rolled back

7: Support property reset before connection recycling (for example: autocommit, transactionisolation, readonly, Catlog, schema, networktimeout)

8: JMX support

9: Support connection factory customization


Configuration item Description remark
username JDBC username
password JDBC password
jdbcUrl JDBC url
driverClassName Driver class name
poolName Pool name
fairMode fair mode for pool default is false
initialSize pool initial size
maxActive pool max size
concurrentSize borrower thread concurrent size not greater than 'maxActive'
preparedStatementCacheSize statment cache size 0 cache is invalid
testOnBorrow test connection valid on borrowed invalid,then close it
testOnReturn test connection valid on return invalid,then close it
defaultAutoCommit default autoCommit default is true
defaultTransactionIsolation trasaction level default:Connection.TRANSACTION_READ_COMMITTED
defaultReadOnly default is false
maxWait max wait time to borrow a connection(mills) default is 8 seconds
idleTimeout max idle time in pool(mills) default is 3 minutes
holdIdleTimeout max hold idle time in pool(mills) default is 5 minutes
connectionTestSQL Connection valid test sql a 'select' statment
connectionTestTimeout Connection valid test timeout(seconds) default 5 seconds
connectionTestInterval connection valid test interval time(mills) default 500ms
forceCloseConnection connection close force ind default is false,true:close using directly,false:close using when it is idle
waitTimeToClearPool wait time to clean when exist using conneciton(seconds) default is 3 seconds
idleCheckTimeInterval idle check time interval(mills)
idleCheckTimeInitDelay idle check thread delay time to check first
connectionFactoryClassName Custom JDBC connection factory class name default is null
enableJMX JMX Ind
You can’t perform that action at this time.