public class JDBCConfigurationSource extends Object implements PolledConfigurationSource
| Constructor and Description |
|---|
JDBCConfigurationSource(DataSource datasource,
String query,
String keyColumnName,
String valueColumnName)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected Connection |
getConnection()
Returns a
Connection object. |
DataSource |
getDatasource()
Returns the used
DataSource object. |
PollResult |
poll(boolean initial,
Object checkPoint)
Poll the configuration source to get the latest content.
|
public JDBCConfigurationSource(DataSource datasource, String query, String keyColumnName, String valueColumnName)
datasource - The DataSource object for the JDBC; e.g.
new OracleDataSource(databaseName, schema);query - The query statement to fetch the properties; e.g.
"Select distinct property_key, property_value from SITE_PROPERTIES"keyColumnName - The column name which stores the property keys; e.g.
property_keyvalueColumnName - The column name which stores the property values; e.g.
property_valuepublic PollResult poll(boolean initial, Object checkPoint) throws Exception
PolledConfigurationSourcepoll in interface PolledConfigurationSourceinitial - true if this operation is the first poll.checkPoint - Object that is used to determine the starting point if the result returned is incremental.
Null if there is no check point or the caller wishes to get the full content.Exception - If any exception occurs when fetching the configurations.public DataSource getDatasource()
DataSource object.protected Connection getConnection() throws SQLException
Connection object. This method is called when ever
the database is to be accessed. This implementation returns a connection
from the current DataSource.Connection object to be usedSQLException - if an error occursCopyright © 2015. All Rights Reserved.