com.holonplatform.jdbc.internal

## Class DefaultDataSourceBuilder.DefaultBuilder

- java.lang.Object
- - com.holonplatform.jdbc.internal.DefaultDataSourceBuilder.DefaultBuilder

- All Implemented Interfaces:
    DataSourceBuilder.Builder
  Enclosing class:
    DefaultDataSourceBuilder

      public static class DefaultDataSourceBuilder.DefaultBuilder
      extends Object
      implements DataSourceBuilder.Builder

  Default `Builder`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultBuilder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DataSourceBuilder.Builder` | `autoCommit(boolean autoCommit)` Set the DataSource connection auto-commit mode.
    `DataSource` | `build()` Build the `DataSource`.
    `DataSourceBuilder.Builder` | `database(DatabasePlatform databasePlatform)` Set the database platform to which the DataSource is connected.
    `DataSourceBuilder.Builder` | `driverClassName(String driverClassName)` Set the JDBC driver class name.
    `DataSourceBuilder.Builder` | `maxPoolSize(int maxPoolSize)` For connection pooling DataSources, set the upper limit of the connections pool.
    `DataSourceBuilder.Builder` | `minPoolSize(int minPoolSize)` For connection pooling DataSources, set the lower limit of the connections pool.
    `DataSourceBuilder.Builder` | `name(String name)` Set the DataSource instance name, if supported by concrete DataSource implementation.
    `DataSourceBuilder.Builder` | `password(String password)` Set the JDBC connection password.
    `DataSourceBuilder.Builder` | `type(DataSourceType type)` Set the DataSource type.
    `DataSourceBuilder.Builder` | `type(String typeName)` Set the DataSource type name.
    `DataSourceBuilder.Builder` | `url(String url)` Set the JDBC connection URL.
    `DataSourceBuilder.Builder` | `username(String username)` Set the JDBC connection username.
    `DataSourceBuilder.Builder` | `validationQuery(String validationQuery)` For connection pooling DataSources, set the connection validation query.
    `DataSourceBuilder.Builder` | `withInitScript(String sqlScript)` Add a SQL intitialization script.
    `DataSourceBuilder.Builder` | `withInitScriptResource(String sqlScriptResourceName)` Add a SQL intitialization script read from given classpath resource name (for example a file name).

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### DefaultBuilder

          public DefaultBuilder()

  - ### Method Detail

    - #### type

          public DataSourceBuilder.Builder type(String typeName)

      Description copied from interface: `DataSourceBuilder.Builder`
      Set the DataSource type name.
      Specified by:
        `type` in interface `DataSourceBuilder.Builder`
      Parameters:
        `typeName` - the DataSource type name (not null)
      Returns:
        this

    - #### type

          public DataSourceBuilder.Builder type(DataSourceType type)

      Description copied from interface: `DataSourceBuilder.Builder`
      Set the DataSource type.
      Specified by:
        `type` in interface `DataSourceBuilder.Builder`
      Parameters:
        `type` - the DataSource type (not null)
      Returns:
        this

    - #### name

          public DataSourceBuilder.Builder name(String name)

      Description copied from interface: `DataSourceBuilder.Builder`
      Set the DataSource instance name, if supported by concrete DataSource implementation.
      Specified by:
        `name` in interface `DataSourceBuilder.Builder`
      Parameters:
        `name` - the DataSource name
      Returns:
        this

    - #### driverClassName

          public DataSourceBuilder.Builder driverClassName(String driverClassName)

      Description copied from interface: `DataSourceBuilder.Builder`
      Set the JDBC driver class name.
      Specified by:
        `driverClassName` in interface `DataSourceBuilder.Builder`
      Parameters:
        `driverClassName` - the JDBC driver class name
      Returns:
        this

    - #### url

          public DataSourceBuilder.Builder url(String url)

      Description copied from interface: `DataSourceBuilder.Builder`
      Set the JDBC connection URL.
      Specified by:
        `url` in interface `DataSourceBuilder.Builder`
      Parameters:
        `url` - the JDBC connection URL
      Returns:
        this

    - #### username

          public DataSourceBuilder.Builder username(String username)

      Description copied from interface: `DataSourceBuilder.Builder`
      Set the JDBC connection username.
      Specified by:
        `username` in interface `DataSourceBuilder.Builder`
      Parameters:
        `username` - the JDBC connection username
      Returns:
        this

    - #### password

          public DataSourceBuilder.Builder password(String password)

      Description copied from interface: `DataSourceBuilder.Builder`
      Set the JDBC connection password.
      Specified by:
        `password` in interface `DataSourceBuilder.Builder`
      Parameters:
        `password` - the JDBC connection password
      Returns:
        this

    - #### database

          public DataSourceBuilder.Builder database(DatabasePlatform databasePlatform)

      Description copied from interface: `DataSourceBuilder.Builder`
      Set the database platform to which the DataSource is connected.

      Can be used for example to auto-detect a suitable JDBC driver.

      Specified by:
        `database` in interface `DataSourceBuilder.Builder`
      Parameters:
        `databasePlatform` - the database platform
      Returns:
        this

    - #### autoCommit

          public DataSourceBuilder.Builder autoCommit(boolean autoCommit)

      Description copied from interface: `DataSourceBuilder.Builder`
      Set the DataSource connection auto-commit mode.
      Specified by:
        `autoCommit` in interface `DataSourceBuilder.Builder`
      Parameters:
        `autoCommit` - `true` to enable connection auto-commit, `false` to disable
      Returns:
        this

    - #### minPoolSize

          public DataSourceBuilder.Builder minPoolSize(int minPoolSize)

      Description copied from interface: `DataSourceBuilder.Builder`
      For connection pooling DataSources, set the lower limit of the connections pool.
      Specified by:
        `minPoolSize` in interface `DataSourceBuilder.Builder`
      Parameters:
        `minPoolSize` - Minimum connection pool size
      Returns:
        this

    - #### maxPoolSize

          public DataSourceBuilder.Builder maxPoolSize(int maxPoolSize)

      Description copied from interface: `DataSourceBuilder.Builder`
      For connection pooling DataSources, set the upper limit of the connections pool.
      Specified by:
        `maxPoolSize` in interface `DataSourceBuilder.Builder`
      Parameters:
        `maxPoolSize` - Maximum connection pool size
      Returns:
        this

    - #### validationQuery

          public DataSourceBuilder.Builder validationQuery(String validationQuery)

      Description copied from interface: `DataSourceBuilder.Builder`
      For connection pooling DataSources, set the connection validation query.
      Specified by:
        `validationQuery` in interface `DataSourceBuilder.Builder`
      Parameters:
        `validationQuery` - the connection validation query
      Returns:
        this

    - #### withInitScript

          public DataSourceBuilder.Builder withInitScript(String sqlScript)

      Description copied from interface: `DataSourceBuilder.Builder`
      Add a SQL intitialization script.

      Supported SQL scripts format:

      - The semicolon punctuation mark (`;`) must be used as SQL statements separator
      - Single line comments must be prefixed by `--`
      - Block comments must be delimited by `\*` and `*/`
      Specified by:
        `withInitScript` in interface `DataSourceBuilder.Builder`
      Parameters:
        `sqlScript` - SQL intitialization script (not null)
      Returns:
        this

    - #### withInitScriptResource

          public DataSourceBuilder.Builder withInitScriptResource(String sqlScriptResourceName)

      Description copied from interface: `DataSourceBuilder.Builder`
      Add a SQL intitialization script read from given classpath resource name (for example a file name). `ClassLoader.getResourceAsStream(String)` is used to load the resource, using the same conventions to locate the resource to load. UTF-8 is assumed as default encoding.

      Supported SQL scripts format:

      - The semicolon punctuation mark (`;`) must be used as SQL statements separator
      - Single line comments must be prefixed by `--`
      - Block comments must be delimited by `\*` and `*/`
      Specified by:
        `withInitScriptResource` in interface `DataSourceBuilder.Builder`
      Parameters:
        `sqlScriptResourceName` - SQL script resource name
      Returns:
        this

    - #### build

          public DataSource build()

      Description copied from interface: `DataSourceBuilder.Builder`
      Build the `DataSource`.
      Specified by:
        `build` in interface `DataSourceBuilder.Builder`
      Returns:
        the `DataSource` instance

Copyright © 2019 The Holon Platform. All rights reserved.