de.cesr.parma.reader
Class PmDbParameterReader
java.lang.Object
de.cesr.parma.core.PmAbstractParameterReader
de.cesr.parma.reader.PmDbParameterReader
- All Implemented Interfaces:
- PmParameterReader
public class PmDbParameterReader
- extends PmAbstractParameterReader
Parameter retrieval from MySQL databases
PARameter MAnager
Connects to a MySQL database using parameter values of PmFrameworkPa.LOCATION
, PmFrameworkPa.DBNAME
,
PmFrameworkPa.USER
, and PmFrameworkPa.PASSWORD
and reads in parameter values from
PmFrameworkPa.TBLNAME_PARAMS
(the row that is defined by parameter set id - see
PmDbParameterReader(PmParameterDefinition)
).
This reader enables the use of other db settings and tables than defined in PmFrameworkPa
via setter methods for theses settings. However, defaults are the values of PmFrameworkPa
.
See documentation for further instructions.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NOT_DEFINED
public static final String NOT_DEFINED
- See Also:
- Constant Field Values
dbTable
protected PmParameterDefinition dbTable
dbLocation
protected PmParameterDefinition dbLocation
dbName
protected PmParameterDefinition dbName
dbUser
protected PmParameterDefinition dbUser
dbPassword
protected PmParameterDefinition dbPassword
PmDbParameterReader
public PmDbParameterReader(PmParameterDefinition paramSetId)
- Uses the given parameter definition as parameter set ID.
- Parameters:
paramSetId
- the parameter definition that specifies the parameter set id
for which parameter definitions shall be fetched from DB,
PmDbParameterReader
public PmDbParameterReader()
- Uses
PmFrameworkPa.PARAM_SET_ID
as parameter set ID.
initParameters
public void initParameters()
- Description copied from interface:
PmParameterReader
- (Recursively) init parameters.
- Specified by:
initParameters
in interface PmParameterReader
- Overrides:
initParameters
in class PmAbstractParameterReader
- See Also:
PmAbstractParameterReader.initParameters()
connect
protected ResultSet connect(String sql)
- Parameters:
sql
-
- Returns:
- Created by Sascha Holzhauer on 29.03.2010
getConnection
protected Connection getConnection()
throws InstantiationException,
IllegalAccessException,
ClassNotFoundException,
SQLException
- Tries to establish a JDBC Connection to the MySQL database given the settings provided to the constructor.
- Throws:
InstantiationException
IllegalAccessException
ClassNotFoundException
SQLException
disconnect
protected void disconnect()