public DataSource createDataSource(Properties props) throws SQLException {
    props = new SingleUseProperties(props);
    if (props.containsKey(JDBC_INITIAL_POOL_SIZE)
        || props.containsKey(JDBC_MIN_POOL_SIZE)
        || props.containsKey(JDBC_MAX_POOL_SIZE)
        || props.containsKey(JDBC_MAX_IDLE_TIME)
        || props.containsKey(JDBC_MAX_STATEMENTS)) {
      return createPoolingDataSource(props);
    } else {
      return createSimpleDataSource(props);
    }
  }
public DataSource createDataSource ( Properties props ) throws SQLException { props = new SingleUseProperties ( props ) ; if ( props . containsKey ( JDBC_INITIAL_POOL_SIZE ) || props . containsKey ( JDBC_MIN_POOL_SIZE ) || props . containsKey ( JDBC_MAX_POOL_SIZE ) || props . containsKey ( JDBC_MAX_IDLE_TIME ) || props . containsKey ( JDBC_MAX_STATEMENTS ) ) { return createPoolingDataSource ( props ) ; } else { return createSimpleDataSource ( props ) ; } }
Will create and return either a {@link SimpleDataSource} or a {@link PoolingDataSource}
depending on the presence in the supplied properties of any pool-related property (eg.: {@code
JDBC_INITIAL_POOL_SIZE} or {@code JDBC_MAX_POOL_SIZE}).