Package adams.tools
Class InitializeTables
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,DatabaseConnectionHandler
,DatabaseConnectionProvider
,DatabaseConnectionUser
,Serializable
,Comparable
public class InitializeTables extends AbstractDatabaseTool
Makes sure that all tables exist and are initialized. Can be called at runtime to re-create tables that got dropped.
Valid options are:
-D (property: debug) If set to true, scheme may output additional info to the console.
-driver <java.lang.String> (property: driver) The JDBC driver. default: com.mysql.jdbc.Driver
-url <java.lang.String> (property: URL) The database URL.
-user <java.lang.String> (property: user) The database user.
-password <java.lang.String> (property: password) The password of the database user.
- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class adams.tools.AbstractDatabaseTool
m_dbc
-
Fields inherited from class adams.tools.AbstractTool
m_Stopped
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description InitializeTables()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doRun()
Attempt to load the file and save to db.protected AbstractDatabaseConnection
getDefaultDatabaseConnection()
Returns the default database connection.String
globalInfo()
Returns a string describing the object.-
Methods inherited from class adams.tools.AbstractDatabaseTool
cleanUp, getDatabaseConnection, initialize, setDatabaseConnection
-
Methods inherited from class adams.tools.AbstractTool
compareTo, destroy, equals, forCommandLine, forName, getTools, isStopped, postRun, preRun, run, runTool, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
getDefaultDatabaseConnection
protected AbstractDatabaseConnection getDefaultDatabaseConnection()
Returns the default database connection.- Specified by:
getDefaultDatabaseConnection
in classAbstractDatabaseTool
- Returns:
- the database connection
-
doRun
protected void doRun()
Attempt to load the file and save to db. Exit java upon failure- Specified by:
doRun
in classAbstractTool
-
-