Class DataSourceManager

java.lang.Object
com.invirgance.convirgance.jdbc.datasource.DataSourceManager

public class DataSourceManager extends Object
Exposes data source properties at runtime, allowing for dynamic configuration of DataSource instances.
Author:
jbanes
  • Constructor Details

    • DataSourceManager

      public DataSourceManager(DataSource source)
  • Method Details

    • getDataSource

      public DataSource getDataSource()
    • getProperties

      public String[] getProperties()
      Returns the properties available on the DataSource. These can be used to configure how the Driver that uses this DataSource connects to the database.
      Returns:
      Property names.
    • getProperty

      public Object getProperty(String name)
      Returns the value assigned to the data source's property.
      Parameters:
      name - Property name.
      Returns:
      The value.
    • setProperty

      public void setProperty(String name, String value)
      Assign a value to one of the data source's properties. This will modify how drivers that utilize this data source create connections. Such as configuring SSL, setting cache properties etc...
      Parameters:
      name - Property name.
      value - Value to set.
    • setProperty

      public void setProperty(String name, Object value)
      Sets a property value on the data source. A list of properties can be found with getProperties() The values are set for the current run-time and do not persist.
      Parameters:
      name - Property name.
      value - Property value.
    • getConfig

      public com.invirgance.convirgance.json.JSONObject getConfig()
      Creates a clone of the data sources configuration.
      Returns:
      The configuration.
    • setConfig

      public void setConfig(com.invirgance.convirgance.json.JSONObject config)
      Merges the provided configuration with the current one, overwriting existing values.
      Parameters:
      config - The configuration