code: public static Connection getConnection(final ConnectionProperties poolSpec)
              throws FactoryException {
  
          Validate.notNull(poolSpec, "The validated object 'poolSpec' is null");
          Validate.notBlank(poolSpec.getDriver(),
                  "The validated character sequence 'poolSpec.getDriver()' is null or empty");
          Validate.notBlank(poolSpec.getUrl(), "The validated character sequence 'poolSpec.getUrl()' is null or empty");
  
          // no need for defensive copies of Strings
  
          try {
              return DataSourceFactory.getDataSource(poolSpec).getConnection();
          } catch (SQLException e) {
              // a connection is identified by the URL, the username, and the password
              final String key = String.format("%s:%s", poolSpec.getUrl(), poolSpec.getUsername());
              final String error = "Error retrieving JDBC connection from pool: " + key;
              LOG.warn(error);
              throw new FactoryException(error, e);
          }
      }
docs: Return a Connection instance from a pool that manages JDBC driver based connections.
  <p>
  The driver-based connection are managed in a connection pool. The pool is created using the provided properties
  for both the connection and the pool spec. Once the pool has been created, it is cached (based on URL and
  username), and can no longer be changed. Subsequent calls to this method will return a connection from the
  cached pool, and changes in the pool spec (e.g. changes to the size of the pool) will be ignored.
  
  @param poolSpec A connection pool spec that has the driver and url configured as non-empty strings
  @return a JDBC connection
  @throws FactoryException         When the connection cannot be retrieved from the pool, or the pool cannot be
  created
  @throws NullPointerException     When the {@code poolSpec}, {@code poolSpec.getDriver()}, or
  {@code poolSpec.getUrl()} are {@code null}
  @throws IllegalArgumentException When {@code poolSpec.getDriver()} or {@code poolSpec.getUrl()} are empty