com.holonplatform.jdbc

## Interface DataSourceConfigProperties

- All Superinterfaces:
    com.holonplatform.core.config.ConfigPropertySet, com.holonplatform.core.datastore.DataContextBound
  All Known Subinterfaces:
    SpringDataSourceConfigProperties
  All Known Implementing Classes:
    DataSourceConfigProperties.DataSourceConfigPropertiesImpl, SpringDataSourceConfigProperties.SpringDataSourceConfigPropertiesImpl

      public interface DataSourceConfigProperties
      extends com.holonplatform.core.config.ConfigPropertySet, com.holonplatform.core.datastore.DataContextBound

  A `ConfigPropertySet` for `DataSource` configuration, using `DEFAULT_NAME` as property prefix.

  When DataSourceConfigProperties are used in conjunction with a data context id to discriminate multiple `DataSource` configurations, configuration properties must be written using that id as prefix, for example, if data context id is `myid`:
  `holon.datasource.myid.url=...`

  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `DataSourceConfigProperties.DataSourceConfigPropertiesImpl` Default implementation

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.config.ConfigPropertySet

      `com.holonplatform.core.config.ConfigPropertySet.Builder<C extends com.holonplatform.core.config.ConfigPropertySet>, com.holonplatform.core.config.ConfigPropertySet.ConfigurationException`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static com.holonplatform.core.config.ConfigProperty<Boolean>` | `AUTOCOMMIT` Enable/Disable auto-commit for JDBC driver
    `static int` | `DEFAULT_MAX_POOL_SIZE` Default max pool size for pooling DataSource
    `static String` | `DEFAULT_NAME` Configuration property set default name
    `static com.holonplatform.core.config.ConfigProperty<String>` | `DRIVER_CLASS_NAME` JDBC Driver class name
    `static com.holonplatform.core.config.ConfigProperty<String>` | `JNDI_NAME` JNDI lookup name.
    `static com.holonplatform.core.config.ConfigProperty<Integer>` | `MAX_POOL_SIZE` DataSource max pool size (for pooling DataSource types)
    `static com.holonplatform.core.config.ConfigProperty<Integer>` | `MIN_POOL_SIZE` DataSource min pool size (for pooling DataSource types)
    `static com.holonplatform.core.config.ConfigProperty<String>` | `NAME` DataSource name
    `static com.holonplatform.core.config.ConfigProperty<String>` | `PASSWORD` JDBC connection password
    `static com.holonplatform.core.config.ConfigProperty<DatabasePlatform>` | `PLATFORM` Database platform to use.
    `static com.holonplatform.core.config.ConfigProperty<String>` | `TYPE` DataSource type
    `static com.holonplatform.core.config.ConfigProperty<String>` | `URL` JDBC connection url
    `static com.holonplatform.core.config.ConfigProperty<String>` | `USERNAME` JDBC connection username
    `static com.holonplatform.core.config.ConfigProperty<String>` | `VALIDATION_QUERY` Optional connection validation query for pooling DataSources

  - ### Method Summary

    All Methods Static Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static com.holonplatform.core.config.ConfigPropertySet.Builder<DataSourceConfigProperties>` | `builder()` Builder to create property set instances bound to a property data source, without data context id specification.
    `static com.holonplatform.core.config.ConfigPropertySet.Builder<DataSourceConfigProperties>` | `builder(String dataContextId)` Builder to create property set instances bound to a property data source.
    `default Optional<String>` | `getConnectionValidationQuery()` Gets connection validation query, if configured or if a default validation query is available
    `default DatabasePlatform` | `getDatabasePlatform()` Gets configured `DatabasePlatform` or try to detect it from connection url, if available
    `default Optional<String>` | `getDriverClassName()` Try to obtain the JDBC Driver class name, either from `DRIVER_CLASS_NAME` property or using the default driver class name for the configured database platform, if available.
    `default boolean` | `isDisableAutoCommit()` Gets whether to disable connection auto-commit

    - ### Methods inherited from interface com.holonplatform.core.config.ConfigPropertySet

      `getConfigPropertyName, getConfigPropertyValue, getConfigPropertyValue, getConfigPropertyValueOrElse, getName, getSubPropertiesUsingPrefix, hasConfigProperty`

    - ### Methods inherited from interface com.holonplatform.core.datastore.DataContextBound

      `getDataContextId`

- - ### Field Detail

    - #### DEFAULT_NAME

          static final String DEFAULT_NAME

      Configuration property set default name
      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_POOL_SIZE

          static final int DEFAULT_MAX_POOL_SIZE

      Default max pool size for pooling DataSource
      See Also:
        Constant Field Values

    - #### TYPE

          static final com.holonplatform.core.config.ConfigProperty<String> TYPE

      DataSource type

    - #### DRIVER_CLASS_NAME

          static final com.holonplatform.core.config.ConfigProperty<String> DRIVER_CLASS_NAME

      JDBC Driver class name

    - #### URL

          static final com.holonplatform.core.config.ConfigProperty<String> URL

      JDBC connection url

    - #### USERNAME

          static final com.holonplatform.core.config.ConfigProperty<String> USERNAME

      JDBC connection username

    - #### PASSWORD

          static final com.holonplatform.core.config.ConfigProperty<String> PASSWORD

      JDBC connection password

    - #### NAME

          static final com.holonplatform.core.config.ConfigProperty<String> NAME

      DataSource name

    - #### PLATFORM

          static final com.holonplatform.core.config.ConfigProperty<DatabasePlatform> PLATFORM

      Database platform to use. Must be one of the names enumerated in `DatabasePlatform`.

      Auto-detected by default.

    - #### AUTOCOMMIT

          static final com.holonplatform.core.config.ConfigProperty<Boolean> AUTOCOMMIT

      Enable/Disable auto-commit for JDBC driver

    - #### MIN_POOL_SIZE

          static final com.holonplatform.core.config.ConfigProperty<Integer> MIN_POOL_SIZE

      DataSource min pool size (for pooling DataSource types)

    - #### MAX_POOL_SIZE

          static final com.holonplatform.core.config.ConfigProperty<Integer> MAX_POOL_SIZE

      DataSource max pool size (for pooling DataSource types)

    - #### VALIDATION_QUERY

          static final com.holonplatform.core.config.ConfigProperty<String> VALIDATION_QUERY

      Optional connection validation query for pooling DataSources

    - #### JNDI_NAME

          static final com.holonplatform.core.config.ConfigProperty<String> JNDI_NAME

      JNDI lookup name. If this property is setted, driver class, url, username and password are ignored.

  - ### Method Detail

    - #### isDisableAutoCommit

          default boolean isDisableAutoCommit()

      Gets whether to disable connection auto-commit
      Returns:
        True to disable connection auto-commit

    - #### getDatabasePlatform

          default DatabasePlatform getDatabasePlatform()

      Gets configured `DatabasePlatform` or try to detect it from connection url, if available
      Returns:
        DatabasePlatform

    - #### getDriverClassName

          default Optional<String> getDriverClassName()

      Try to obtain the JDBC Driver class name, either from `DRIVER_CLASS_NAME` property or using the default driver class name for the configured database platform, if available.
      Returns:
        Driver class name, empty if not available

    - #### getConnectionValidationQuery

          default Optional<String> getConnectionValidationQuery()

      Gets connection validation query, if configured or if a default validation query is available
      Returns:
        Connection validation query, empty if not available

    - #### builder

          static com.holonplatform.core.config.ConfigPropertySet.Builder<DataSourceConfigProperties> builder(String dataContextId)

      Builder to create property set instances bound to a property data source.
      Parameters:
        `dataContextId` - Optional data context id to which DataSource is bound
      Returns:
        ConfigPropertySet builder

    - #### builder

          static com.holonplatform.core.config.ConfigPropertySet.Builder<DataSourceConfigProperties> builder()

      Builder to create property set instances bound to a property data source, without data context id specification.
      Returns:
        ConfigPropertySet builder

Copyright © 2019 The Holon Platform. All rights reserved.