class DefaultPoolFactory implements JdbcPoolFactory, ConnectionPoolBuilder {

  @Override
  public C3P0PooledDataSource build(PluggableJdbcPooledConnection conn) throws Exception {
    ComboPooledDataSource pool = create();
    pool.setProperties(conn.connectionProperties());
    pool.setDriverClass(conn.getDriverImp());
    pool.setJdbcUrl(conn.getConnectUrl());
    pool.setUser(conn.getUsername());
    pool.setPassword(Password.decode(ExternalResolver.resolve(conn.getPassword())));
    PooledConnectionProperties.apply(conn.poolProperties(), pool);
    return new C3P0PooledDataSource(pool);
  }

}