@Override public synchronized void start() { try { pool = new BoneCP(config); } catch (SQLException e) { throw new RuntimeException(e); } }
public BoneCPConnectionProvider(String connectionUrl, String username, String password, Map<String, String> providerAttributes) throws SQLException { _connectionPool = new BoneCP(createBoneCPConfig(connectionUrl, username, password, providerAttributes)); }
public JDBCConnectionPool(final String jdbcString, final int numberOfConnection) throws SQLException { super(); this.numberOfConnection = numberOfConnection; this.jdbcString = jdbcString; BoneCPConfig config = new BoneCPConfig(); config.setJdbcUrl(jdbcString); this.connectionPool = new BoneCP(config); this.connectionSession = new HashMap<String, Connection>(); }
/** * @throws SQLException * */ private void maybeInit() throws SQLException { try { if (this.getDriverClass() != null) { this.loadClass(this.getDriverClass()); } } catch (final ClassNotFoundException e) { throw new SQLException(PoolUtil.stringifyException(e)); } BoneCPDataSource.logger.debug(this.toString()); this.pool = new FinalWrapper<BoneCP>(new BoneCP(this)); }
e.printStackTrace(); connectionPool = new BoneCP(config); // setup the connection pool
config.setPartitionCount(1); connectionPool = new BoneCP(config);
config.setPartitionCount(1); connectionPool = new BoneCP(config);
/** * {@inheritDoc} * * @see javax.sql.DataSource#getConnection() */ public Connection getConnection() throws SQLException { FinalWrapper<BoneCP> wrapper = this.pool; if (wrapper == null) { synchronized (this) { if (this.pool == null) { try{ if (this.getDriverClass() != null){ loadClass(this.getDriverClass()); } logger.debug(this.toString()); this.pool = new FinalWrapper<BoneCP>(new BoneCP(this)); } catch (ClassNotFoundException e) { throw new SQLException(PoolUtil.stringifyException(e)); } } wrapper = this.pool; } } return wrapper.value.getConnection(); }
public JDBCManager(String driver, String connectionUri, int nConnectionsPool, String userName, String password) throws SQLException, ClassNotFoundException { Class.forName(driver); BoneCPConfig config = new BoneCPConfig(); config.setJdbcUrl(connectionUri); config.setMinConnectionsPerPartition(nConnectionsPool); config.setMaxConnectionsPerPartition(nConnectionsPool); config.setUsername(userName); config.setPassword(password); config.setPartitionCount(1); config.setDefaultAutoCommit(false); connectionPool = new BoneCP(config); // setup the connection pool }
this.bonecp = new BoneCP(config); if(LOG.isInfoEnabled()) { LOG.info("Fetching a test connnection.");
public JDBCManager(String driver, String connectionUri, int nConnectionsPool, String userName, String password) throws SQLException, ClassNotFoundException { Class.forName(driver); BoneCPConfig config = new BoneCPConfig(); config.setJdbcUrl(connectionUri); config.setMinConnectionsPerPartition(nConnectionsPool); config.setMaxConnectionsPerPartition(nConnectionsPool); config.setUsername(userName); config.setPassword(password); config.setPartitionCount(1); config.setDefaultAutoCommit(false); connectionPool = new BoneCP(config); // setup the connection pool }