/** Drops a driver from the DriverManager's list. */ protected void unregisterDriver(){ String jdbcURL = this.config.getJdbcUrl(); if ((jdbcURL != null) && this.config.isDeregisterDriverOnClose()){ logger.info("Unregistering JDBC driver for : "+jdbcURL); try { DriverManager.deregisterDriver(DriverManager.getDriver(jdbcURL)); } catch (SQLException e) { logger.info("Unregistering driver failed.", e); } } }
/** * Drops a driver from the DriverManager's list. */ protected void unregisterDriver() { String jdbcURL = this.config.getJdbcUrl(); if ((jdbcURL != null) && this.config.isDeregisterDriverOnClose()) { LOGGER.info("Unregistering JDBC driver for : " + jdbcURL); try { DriverManager.deregisterDriver(DriverManager.getDriver(jdbcURL)); } catch (SQLException e) { LOGGER.info("Unregistering driver failed.", e); } } }
String url = this.config.getJdbcUrl(); String username = this.config.getUsername(); String password = this.config.getPassword();
public String toString(){ long timeMillis = System.currentTimeMillis(); return Objects.toStringHelper(this) .add("url", this.pool.getConfig().getJdbcUrl()) .add("user", this.pool.getConfig().getUsername()) .add("debugHandle", this.debugHandle) .add("lastResetAgoInSec", TimeUnit.MILLISECONDS.toSeconds(timeMillis-this.connectionLastResetInMs)) .add("lastUsedAgoInSec", TimeUnit.MILLISECONDS.toSeconds(timeMillis-this.connectionLastUsedInMs)) .add("creationTimeAgoInSec", TimeUnit.MILLISECONDS.toSeconds(timeMillis-this.connectionCreationTimeInMs)) .toString(); }
String url = this.config.getJdbcUrl(); String username = this.config.getUsername(); String password = this.config.getPassword();
/** * Partition constructor * * @param pool handle to connection pool */ public ConnectionPartition(BoneCP pool) { BoneCPConfig config = pool.getConfig(); this.minConnections = config.getMinConnectionsPerPartition(); this.maxConnections = config.getMaxConnectionsPerPartition(); this.acquireIncrement = config.getAcquireIncrement(); this.url = config.getJdbcUrl(); this.username = config.getUsername(); this.password = config.getPassword(); this.poolName = config.getPoolName() != null ? "(in pool '"+config.getPoolName()+"') " : ""; this.pool = pool; this.disableTracking = config.isDisableConnectionTracking(); this.queryExecuteTimeLimitInNanoSeconds = TimeUnit.NANOSECONDS.convert(config.getQueryExecuteTimeLimitInMs(), TimeUnit.MILLISECONDS); }
Connection result; Connection oldRawConnection = connectionHandle.getInternalConnection(); String url = this.getConfig().getJdbcUrl();
Connection result = null; Connection oldRawConnection = connectionHandle.getInternalConnection(); String url = this.getConfig().getJdbcUrl();
config.getConnectionHook().onAcquireFail(e, acquireConfig); throw PoolUtil.generateSQLException(String.format(ERROR_TEST_CONNECTION, config.getJdbcUrl(), config.getUsername(), PoolUtil.stringifyException(e)), e);
@Override public String toString() { return Objects.toStringHelper(this) .add("url", this.pool.getConfig().getJdbcUrl()) .add("user", this.pool.getConfig().getUsername()) .add("minConnections", this.getMinConnections()) .add("maxConnections", this.getMaxConnections()) .add("acquireIncrement", this.acquireIncrement) .add("createdConnections", this.createdConnections) .add("freeConnections", this.getFreeConnections()) .toString(); } }
config.getConnectionHook().onAcquireFail(e, acquireConfig); throw PoolUtil.generateSQLException(String.format(ERROR_TEST_CONNECTION, config.getJdbcUrl(), config.getUsername(), PoolUtil.stringifyException(e)), e);
this.url = pool.getConfig().getJdbcUrl(); this.finalizableRefs = pool.getFinalizableRefs(); this.defaultReadOnly = pool.getConfig().getDefaultReadOnly();
&& Objects.equal(this.idleMaxAgeInSeconds, that.getIdleMaxAge(TimeUnit.SECONDS)) && Objects.equal(this.initSQL, that.getInitSQL()) && Objects.equal(this.jdbcUrl, that.getJdbcUrl()) && Objects.equal(this.maxConnectionsPerPartition, that.getMaxConnectionsPerPartition()) && Objects.equal(this.minConnectionsPerPartition, that.getMinConnectionsPerPartition())