|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.rhi.architecture.batch.HierarchicalDBConfigMixin
Loads configuration information from a database table and adds it to the property information.
Field Summary | |
static java.lang.String |
BASE_ENV
The base value for the second bindable value of the SQL statement |
static java.lang.String |
DB_DRIVER_PROPERTY_NAME
The name of the property that defines the driver to use when connecting to the database from which properties are retrieved. |
static java.lang.String |
DB_PASSWORD_PROPERTY_NAME
The name of the property that defines the password for the database from which properties are retrieved. |
static java.lang.String |
DB_URL_PROPERTY_NAME
The name of the property that defines the URL to the database from which properties are retrieved. |
static java.lang.String |
DB_USER_PROPERTY_NAME
The name of the property that defines the user for the database from which properties are retrieved. |
static java.lang.String[] |
DEFAULT_COLUMNS
The default column names for retrieving properties from the database. |
static java.lang.String |
DEFAULT_SQL
The SQL statement that is used by default is the SQL_QUERY_PROPERTY_NAME is not defined. |
static java.lang.String |
PARENT_PROPERTY_NAME
The name of the property that defines the name of the application that should be used to load baseline properties. |
static java.lang.String |
PROP_SEPARATOR
Separator between heirerarchical properties. |
static java.lang.String |
SCHEMA_PROPERTY_NAME
The name of the property that defines the schema in the database in which the properties table resides. |
static java.lang.String |
SQL_QUERY_PROPERTY_NAME
The name of the property that defines SQL query to use when retrieving properties from the database. |
Constructor Summary | |
HierarchicalDBConfigMixin()
|
Method Summary | |
void |
loadConfiguration(java.util.Properties props)
Retrieve property values and append them to the provided default application properties. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String SQL_QUERY_PROPERTY_NAME
public static final java.lang.String DB_PASSWORD_PROPERTY_NAME
public static final java.lang.String DB_USER_PROPERTY_NAME
public static final java.lang.String DB_URL_PROPERTY_NAME
public static final java.lang.String DB_DRIVER_PROPERTY_NAME
public static final java.lang.String PARENT_PROPERTY_NAME
public static final java.lang.String SCHEMA_PROPERTY_NAME
MessageFormat
to
replace the {0}
in the SQL statement.
public static final java.lang.String[] DEFAULT_COLUMNS
public static final java.lang.String DEFAULT_SQL
SQL_QUERY_PROPERTY_NAME
is not defined. The SQL statement, be it this default one or one
passed in viat the SQL_QUERY_PROPERTY_NAME property, needs to have a {0}
prior
to any table names for formatting; if there is a SCHEMA_PROPERTY_NAME
propery set, this will be replaced with the value therein, otherwise
it is discarded.
public static final java.lang.String PROP_SEPARATOR
public static final java.lang.String BASE_ENV
Constructor Detail |
public HierarchicalDBConfigMixin()
Method Detail |
public void loadConfiguration(java.util.Properties props) throws InitializationException
This method also has a recursive ability to load parent properties. It does this by looking
for a property (PARENT_PROPERTY_NAME
) to be set at the level
at which it is looking; it will do this a far back as there are parent property values set.
The recursion is done by replacing the first bindable value with the value found in PARENT_PROPERTY_NAME
each time such a property is found.
If there is no SQL_QUERY_PROPERTY_NAME
property found, the
default properties SQL statement is set to DEFAULT_SQL
. If a SQL
statement is set, then the names of the columns to get from the result set as the
properties "DatabaseConfigMixin.col0" and quotDatabaseConfigMixin.col1" (if
these are not found, the values default to DEFAULT_COLUMNS
), and
the bindable values in the properties "DatabaseConfigMixin.val0" (used as the
heirerarchical key) through "DatabaseConfigMixin.valN". Also, the value in
the SCHEMA_PROPERTY_NAME
, if it exists, will replace any
instances of {0}
in any SQL statement passed.
The properties in DB_DRIVER_PROPERTY_NAME
, DB_PASSWORD_PROPERTY_NAME
, DB_USER_PROPERTY_NAME
, and DB_URL_PROPERTY_NAME
are all
required for this method to work.
loadConfiguration
in interface ConfigMixin
props
- - the properties used to access the database
InitializationException
- if there is any problem loading properties
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |