/** Just delegates to getUsername for clients hardcoded to "getUser". * @return configured username */ public String getUser() { return getUsername(); } /**
String username = this.config.getUsername(); String password = this.config.getPassword(); Properties props = this.config.getDriverProperties();
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 username = this.config.getUsername(); String password = this.config.getPassword(); Properties props = this.config.getDriverProperties();
/** * 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); }
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);