Package adams.run
Class RunDatabaseScheme
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.run.RunScheme
-
- adams.run.RunDatabaseScheme
-
- All Implemented Interfaces:
Destroyable
,LoggingSupporter
,OptionHandler
,PasswordSupporter
,SizeOfHandler
,DatabaseConnectionEstablisher
,DatabaseConnectionParameterHandler
,Serializable
- Direct Known Subclasses:
RunTool
public abstract class RunDatabaseScheme extends RunScheme implements DatabaseConnectionEstablisher, DatabaseConnectionParameterHandler
Abstract ancestor for RunSchemes that need to access the database.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DatabaseConnection
m_DbConn
database connection.protected BasePassword
m_Password
the password of the database user.protected String
m_URL
the JDBC URL to connect to.protected String
m_User
the database user to use for connecting.-
Fields inherited from class adams.run.RunScheme
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description RunDatabaseScheme()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.void
establishDatabaseConnection()
Establishes the database connection.BasePassword
getPassword()
Returns the password of the database user.String
getURL()
Returns the database URL being used.String
getUser()
Returns the database user used for connecting.protected void
initialize()
initializes member variables.String
passwordTipText()
Returns the tip text for this property.protected void
postRun()
Performs some output/cleanup after the actual run.protected void
preRun()
Performs some initializations before the actual run.void
setPassword(BasePassword value)
Sets the password of the database user.void
setURL(String value)
Sets the database URL.void
setUser(String value)
Sets the database user to use for connecting.String
URLTipText()
Returns the tip text for this property.String
userTipText()
Returns the tip text for this property.-
Methods inherited from class adams.run.RunScheme
cleanUpOptions, destroy, doRun, forCommandLine, forName, getOptionManager, newOptionManager, run, runScheme, toCommandLine
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_DbConn
protected transient DatabaseConnection m_DbConn
database connection.
-
m_URL
protected String m_URL
the JDBC URL to connect to.
-
m_User
protected String m_User
the database user to use for connecting.
-
m_Password
protected BasePassword m_Password
the password of the database user.
-
-
Method Detail
-
initialize
protected void initialize()
initializes member variables.- Overrides:
initialize
in classRunScheme
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classRunScheme
-
setURL
public void setURL(String value)
Sets the database URL.- Specified by:
setURL
in interfaceDatabaseConnectionParameterHandler
- Parameters:
value
- the URL
-
getURL
public String getURL()
Returns the database URL being used.- Specified by:
getURL
in interfaceDatabaseConnectionParameterHandler
- Returns:
- the URL
-
URLTipText
public String URLTipText()
Returns the tip text for this property.- Specified by:
URLTipText
in interfaceDatabaseConnectionParameterHandler
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUser
public void setUser(String value)
Sets the database user to use for connecting.- Specified by:
setUser
in interfaceDatabaseConnectionParameterHandler
- Parameters:
value
- the user
-
getUser
public String getUser()
Returns the database user used for connecting.- Specified by:
getUser
in interfaceDatabaseConnectionParameterHandler
- Returns:
- the user
-
userTipText
public String userTipText()
Returns the tip text for this property.- Specified by:
userTipText
in interfaceDatabaseConnectionParameterHandler
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setPassword
public void setPassword(BasePassword value)
Sets the password of the database user.- Specified by:
setPassword
in interfaceDatabaseConnectionParameterHandler
- Specified by:
setPassword
in interfacePasswordSupporter
- Parameters:
value
- the password
-
getPassword
public BasePassword getPassword()
Returns the password of the database user.- Specified by:
getPassword
in interfaceDatabaseConnectionParameterHandler
- Specified by:
getPassword
in interfacePasswordSupporter
- Returns:
- the password
-
passwordTipText
public String passwordTipText()
Returns the tip text for this property.- Specified by:
passwordTipText
in interfaceDatabaseConnectionParameterHandler
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
establishDatabaseConnection
public void establishDatabaseConnection()
Establishes the database connection.- Specified by:
establishDatabaseConnection
in interfaceDatabaseConnectionEstablisher
-
preRun
protected void preRun() throws Exception
Performs some initializations before the actual run. Connects to the database.
-
-