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 DatabaseConnectionm_DbConndatabase connection.protected BasePasswordm_Passwordthe password of the database user.protected Stringm_URLthe JDBC URL to connect to.protected Stringm_Userthe 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 voiddefineOptions()Adds options to the internal list of options.voidestablishDatabaseConnection()Establishes the database connection.BasePasswordgetPassword()Returns the password of the database user.StringgetURL()Returns the database URL being used.StringgetUser()Returns the database user used for connecting.protected voidinitialize()initializes member variables.StringpasswordTipText()Returns the tip text for this property.protected voidpostRun()Performs some output/cleanup after the actual run.protected voidpreRun()Performs some initializations before the actual run.voidsetPassword(BasePassword value)Sets the password of the database user.voidsetURL(String value)Sets the database URL.voidsetUser(String value)Sets the database user to use for connecting.StringURLTipText()Returns the tip text for this property.StringuserTipText()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:
initializein classRunScheme
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classRunScheme
-
setURL
public void setURL(String value)
Sets the database URL.- Specified by:
setURLin interfaceDatabaseConnectionParameterHandler- Parameters:
value- the URL
-
getURL
public String getURL()
Returns the database URL being used.- Specified by:
getURLin interfaceDatabaseConnectionParameterHandler- Returns:
- the URL
-
URLTipText
public String URLTipText()
Returns the tip text for this property.- Specified by:
URLTipTextin 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:
setUserin interfaceDatabaseConnectionParameterHandler- Parameters:
value- the user
-
getUser
public String getUser()
Returns the database user used for connecting.- Specified by:
getUserin interfaceDatabaseConnectionParameterHandler- Returns:
- the user
-
userTipText
public String userTipText()
Returns the tip text for this property.- Specified by:
userTipTextin 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:
setPasswordin interfaceDatabaseConnectionParameterHandler- Specified by:
setPasswordin interfacePasswordSupporter- Parameters:
value- the password
-
getPassword
public BasePassword getPassword()
Returns the password of the database user.- Specified by:
getPasswordin interfaceDatabaseConnectionParameterHandler- Specified by:
getPasswordin interfacePasswordSupporter- Returns:
- the password
-
passwordTipText
public String passwordTipText()
Returns the tip text for this property.- Specified by:
passwordTipTextin 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:
establishDatabaseConnectionin interfaceDatabaseConnectionEstablisher
-
preRun
protected void preRun() throws ExceptionPerforms some initializations before the actual run. Connects to the database.
-
-