# Class DataSourceBuilder

java.lang.Object
org.apache.cayenne.datasource.DataSourceBuilder

@Deprecated(since="5.0", forRemoval=true) public class DataSourceBuilder extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
in favor of `CayenneDataSource`
A builder class that allows to build a `DataSource` with optional pooling.

Since:
  4.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DataSource`
  `build()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Builds a non-pooling DataSource.
  `DataSourceBuilder`
  `driver(String driver)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  `DataSourceBuilder`
  `driver(Driver driver)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  `DataSourceBuilder`
  `password(String password)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  `PoolingDataSourceBuilder`
  `pool(int minConnection, int maxConnections)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Turns produced DataSource into a pooled DataSource.
  `static DataSourceBuilder`
  `url(String url)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  `DataSourceBuilder`
  `userName(String userName)`
  Deprecated, for removal: This API element is subject to removal in a future version.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### url

    public static DataSourceBuilder url(String url)
    Deprecated, for removal: This API element is subject to removal in a future version.

  - ### userName

    public DataSourceBuilder userName(String userName)
    Deprecated, for removal: This API element is subject to removal in a future version.

  - ### password

    public DataSourceBuilder password(String password)
    Deprecated, for removal: This API element is subject to removal in a future version.

  - ### driver

    public DataSourceBuilder driver(String driver)
    Deprecated, for removal: This API element is subject to removal in a future version.

  - ### driver

    public DataSourceBuilder driver(Driver driver)
    Deprecated, for removal: This API element is subject to removal in a future version.

  - ### pool

    public PoolingDataSourceBuilder pool(int minConnection, int maxConnections)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Turns produced DataSource into a pooled DataSource.

  - ### build

    public DataSource build()
    Deprecated, for removal: This API element is subject to removal in a future version.
    Builds a non-pooling DataSource. To create connection pool use `pool(int, int)` method.