@Test public void testPoolBuilder() throws Exception { HikariPoolBuilder factory = new HikariPoolBuilder(); PluggableJdbcPooledConnection con = createConnection(); HikariDataSourceWrapper pooledDs = (HikariDataSourceWrapper) factory.build(con); HikariDataSource wrapped = pooledDs.wrapped(); assertEquals(con.getConnectUrl(), wrapped.getJdbcUrl()); }
@Override public PooledDataSource build(PluggableJdbcPooledConnection conn) throws Exception { HikariConfig config = new HikariConfig(); config.setJdbcUrl(conn.getConnectUrl()); config.setUsername(conn.getUsername()); config.setPassword(Password.decode(ExternalResolver.resolve(conn.getPassword()))); config.setDriverClassName(conn.getDriverImp()); config.setDataSourceProperties(conn.connectionProperties()); config.setAutoCommit(conn.autoCommit()); conn.poolProperties().stream().forEach((kvp) -> { SimpleBeanUtil.callSetter(config, "set" + kvp.getKey(), kvp.getValue()); }); return new HikariDataSourceWrapper(new HikariDataSource(config)); }
HikariPoolBuilder implements ConnectionPoolBuilder { @Override public PooledDataSource build(PluggableJdbcPooledConnection conn) throws Exception { HikariConfig config = new HikariConfig(); config.setJdbcUrl(conn.getConnectUrl()); config.setUsername(conn.getUsername()); config.setPassword(Password.decode(ExternalResolver.resolve(conn.getPassword()))); config.setDriverClassName(conn.getDriverImp()); config.setDataSourceProperties(conn.connectionProperties()); config.setAutoCommit(conn.autoCommit()); conn.poolProperties().stream().forEach((kvp) -> { SimpleBeanUtil.callSetter(config, "set" + kvp.getKey(), kvp.getValue()); }); return new HikariDataSourceWrapper(new HikariDataSource(config)); } }
HikariPoolBuilder implements ConnectionPoolBuilder { @Override public PooledDataSource build(PluggableJdbcPooledConnection conn) throws Exception { HikariConfig config = new HikariConfig(); config.setJdbcUrl(conn.getConnectUrl()); config.setUsername(conn.getUsername()); config.setPassword(Password.decode(ExternalResolver.resolve(conn.getPassword()))); config.setDriverClassName(conn.getDriverImp()); config.setDataSourceProperties(conn.connectionProperties()); config.setAutoCommit(conn.autoCommit()); conn.poolProperties().stream().forEach((kvp) -> { SimpleBeanUtil.callSetter(config, "set" + kvp.getKey(), kvp.getValue()); }); return new HikariDataSourceWrapper(new HikariDataSource(config)); } HikariPoolBuilder(); }
HikariPoolBuilder implements ConnectionPoolBuilder { @Override public PooledDataSource build(PluggableJdbcPooledConnection conn) throws Exception { HikariConfig config = new HikariConfig(); config.setJdbcUrl(conn.getConnectUrl()); config.setUsername(conn.getUsername()); config.setPassword(Password.decode(ExternalResolver.resolve(conn.getPassword()))); config.setDriverClassName(conn.getDriverImp()); config.setDataSourceProperties(conn.connectionProperties()); config.setAutoCommit(conn.autoCommit()); conn.poolProperties().stream().forEach((kvp) -> { SimpleBeanUtil.callSetter(config, "set" + kvp.getKey(), kvp.getValue()); }); return new HikariDataSourceWrapper(new HikariDataSource(config)); } HikariPoolBuilder(); @Override PooledDataSource build(PluggableJdbcPooledConnection conn); }
HikariPoolBuilder implements ConnectionPoolBuilder { @Override public PooledDataSource build(PluggableJdbcPooledConnection conn) throws Exception { HikariConfig config = new HikariConfig(); config.setJdbcUrl(conn.getConnectUrl()); config.setUsername(conn.getUsername()); config.setPassword(Password.decode(ExternalResolver.resolve(conn.getPassword()))); config.setDriverClassName(conn.getDriverImp()); config.setDataSourceProperties(conn.connectionProperties()); config.setAutoCommit(conn.autoCommit()); conn.poolProperties().stream().forEach((kvp) -> { SimpleBeanUtil.callSetter(config, "set" + kvp.getKey(), kvp.getValue()); }); return new HikariDataSourceWrapper(new HikariDataSource(config)); } HikariPoolBuilder(); @Override PooledDataSource build(PluggableJdbcPooledConnection conn);  }