BeeCP,a lightweight and fast JDBC connection pool implementation.
Name | Description | Remark |
---|---|---|
poolInitSize | pool initialization size | |
poolMaxSize | pool max size | |
borrowerMaxWaitTime | max waiting time for connection borrower | time unit:Millisecond,default value:three minutes |
preparedStatementCacheSize | preparedStatement cache size | |
connectionIdleTimeout | if connections idle time is more then the value,pool will close them | time unit:Millisecond,default value:three minutes |
connectionValidateSQL | test connection is whether active |
String userId="root";
String password="";
String driver="com.mysql.jdbc.Driver";
String URL="jdbc:mysql://localhost/test";
BeeDataSourceConfig config = new JdbcPoolConfig(driver,URL,userId,password);
DataSource datasource = new BeeDataSource(config);
Connection con = datasource.getConnection();
....................