Class DatabaseConfiguration

All Implemented Interfaces:
Configuration, EventSource, ImmutableConfiguration, SynchronizerSupport

public class DatabaseConfiguration extends DatabaseConfiguration
This DatabaseConfiguration checks whether the corresponding table exists before it executes a query or a statement. Some DBMS log a warning or even an error when parsing an SQL that refers to unknown entities or tables.

While this is a rather simple extension, a lot of code has to be copied since org.apache.commons.configuration2.DatabaseConfiguration.JdbcOperation is a private inner instance class.

  • Field Details

    • dataSource

      protected final JDBCDataSource dataSource
      The data source (possibly) providing the table containing the database configuration.
  • Constructor Details

    • DatabaseConfiguration

      public DatabaseConfiguration(JDBCDataSource dataSource, String tableName, String keyColumn, String valueColumn)
      Creates a new DatabaseConfiguration with the designated properties and the designated JDBCDataSource (possibly) providing the table containing the database configuration.
      Parameters:
      dataSource - The data source (possibly) providing the table containing the database configuration.
      tableName - The name of the table containing configuration data.
      keyColumn - The name of the column containing the configuration keys.
      valueColumn - The name of the column containing the configuration values.
  • Method Details