public class JDCConfigReader
extends java.lang.Object
implements java.util.concurrent.Callable<java.util.Map<java.lang.String,java.lang.Object>>
| Constructor and Description |
|---|
JDCConfigReader(javax.sql.DataSource datasource,
java.lang.String query,
java.lang.String keyColumnName,
java.lang.String valueColumnName)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.Object> |
call() |
protected java.sql.Connection |
getConnection()
Returns a
Connection object. |
javax.sql.DataSource |
getDatasource()
Returns the used
DataSource object. |
public JDCConfigReader(javax.sql.DataSource datasource,
java.lang.String query,
java.lang.String keyColumnName,
java.lang.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 java.util.Map<java.lang.String,java.lang.Object> call()
throws java.lang.Exception
call in interface java.util.concurrent.Callable<java.util.Map<java.lang.String,java.lang.Object>>java.lang.Exceptionpublic javax.sql.DataSource getDatasource()
DataSource object.protected java.sql.Connection getConnection()
throws java.sql.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 usedjava.sql.SQLException - if an error occurs