Package adams.tools

Class RunTool

  • All Implemented Interfaces:
    Destroyable, LoggingSupporter, OptionHandler, PasswordSupporter, SizeOfHandler, DatabaseConnectionEstablisher, DatabaseConnectionParameterHandler, Serializable

    public class RunTool
    extends RunDatabaseScheme
    Runs a tool from commandline. Valid options are:

    -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.
     
    -tool <adams.tools.AbstractTool [options]> (property: tool)
             The tool to use.
             default: adams.tools.InitializeTables
     
    Default options for adams.tools.InitializeTables (-tool/tool):
    -D (property: debug)
             If set to true, scheme may output additional info to the console.
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Constructor Detail

      • RunTool

        public RunTool()
    • Method Detail

      • setTool

        public void setTool​(AbstractTool value)
        Sets the tool to run.
        Parameters:
        value - the tool
      • getTool

        public AbstractTool getTool()
        Returns the tool being used.
        Returns:
        the tool
      • toolTipText

        public String toolTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • preRun

        protected void preRun()
                       throws Exception
        Performs some initializations before the actual run. Connects to the database.
        Overrides:
        preRun in class RunDatabaseScheme
        Throws:
        Exception - if something goes wrong
      • doRun

        protected void doRun()
                      throws Exception
        Runs the tool and prints some information to stdout.
        Specified by:
        doRun in class RunScheme
        Throws:
        Exception - if something goes wrong
      • main

        public static void main​(String[] args)
        Runs the tool from commandline.
        Parameters:
        args - the commandline arguments, use -help to display all