Class ScriptFile

java.lang.Object
ecmwf.common.database.ScriptFile
Direct Known Subclasses:
DataBase.ScriptFileImpl

public abstract class ScriptFile extends Object
The Class ScriptFile.
  • Constructor Details

    • ScriptFile

      public ScriptFile()
  • Method Details

    • executeRequest

      public Object executeRequest(File file) throws SQLException, IOException
      Execute request.
      Parameters:
      file - the file
      Returns:
      the object
      Throws:
      SQLException - the SQL exception
      IOException - Signals that an I/O exception has occurred.
    • executeQuery

      public ecmwf.common.database.DBResultSet executeQuery(String menu, String group, String name, Map<String,String> values) throws SQLException, IOException
      Execute query.
      Parameters:
      menu - the menu
      group - the group
      name - the name
      values - the values
      Returns:
      the DB result set
      Throws:
      SQLException - the SQL exception
      IOException - Signals that an I/O exception has occurred.
    • executeQuery

      public <T extends DataBaseObject> ecmwf.common.database.DBIterator<T> executeQuery(String menu, String group, String name, Class<T> resultClass, Map<String,String> values) throws SQLException, IOException
      Execute query.
      Type Parameters:
      T - the generic type
      Parameters:
      menu - the menu
      group - the group
      name - the name
      resultClass - the result class
      values - the values
      Returns:
      the DB iterator
      Throws:
      SQLException - the SQL exception
      IOException - Signals that an I/O exception has occurred.
    • executeQuery

      public ecmwf.common.database.DBResultSet executeQuery(String menu, String group, String name) throws SQLException, IOException
      Execute query.
      Parameters:
      menu - the menu
      group - the group
      name - the name
      Returns:
      the DB result set
      Throws:
      SQLException - the SQL exception
      IOException - Signals that an I/O exception has occurred.
    • executeQuery

      public <T extends DataBaseObject> ecmwf.common.database.DBIterator<T> executeQuery(String menu, String group, String name, Class<T> resultClass) throws SQLException, IOException
      Execute query.
      Type Parameters:
      T - the generic type
      Parameters:
      menu - the menu
      group - the group
      name - the name
      resultClass - the result class
      Returns:
      the DB iterator
      Throws:
      SQLException - the SQL exception
      IOException - Signals that an I/O exception has occurred.
    • executeQuery

      public abstract ecmwf.common.database.DBResultSet executeQuery(String sql) throws SQLException
      Execute query.
      Parameters:
      sql - the sql
      Returns:
      the DB result set
      Throws:
      SQLException - the SQL exception
    • executeQuery

      public abstract <T extends DataBaseObject> ecmwf.common.database.DBIterator<T> executeQuery(Class<T> resultClass, String sql) throws SQLException
      Execute query.
      Type Parameters:
      T - the generic type
      Parameters:
      resultClass - the result class
      sql - the sql
      Returns:
      the DB iterator
      Throws:
      SQLException - the SQL exception
    • executeUpdate

      public int executeUpdate(String menu, String group, String name, Map<String,String> values) throws SQLException, IOException
      Execute update.
      Parameters:
      menu - the menu
      group - the group
      name - the name
      values - the values
      Returns:
      the int
      Throws:
      SQLException - the SQL exception
      IOException - Signals that an I/O exception has occurred.
    • executeUpdate

      public int executeUpdate(String menu, String group, String name) throws SQLException, IOException
      Execute update.
      Parameters:
      menu - the menu
      group - the group
      name - the name
      Returns:
      the int
      Throws:
      SQLException - the SQL exception
      IOException - Signals that an I/O exception has occurred.
    • executeUpdate

      public abstract int executeUpdate(String sql) throws SQLException, IOException
      Execute update.
      Parameters:
      sql - the sql
      Returns:
      the int
      Throws:
      SQLException - the SQL exception
      IOException - Signals that an I/O exception has occurred.
    • getValue

      public String getValue(String name, String comment, String[] possibleValues, String defaultValue)
      Gets the value.
      Parameters:
      name - the name
      comment - the comment
      possibleValues - the possible values
      defaultValue - the default value
      Returns:
      the value
    • showHelp

      public void showHelp(String sql, String message)
      Show help.
      Parameters:
      sql - the sql
      message - the message
    • getConfirmation

      public boolean getConfirmation(String title, String message)
      Gets the confirmation.
      Parameters:
      title - the title
      message - the message
      Returns:
      the confirmation
    • loadScripts

      public void loadScripts(FilenameFilter filter, String repository)
      Load scripts.
      Parameters:
      filter - the filter
      repository - the repository
    • updateScriptContent

      public void updateScriptContent(String menu, String group, String name) throws IOException
      Update script content.
      Parameters:
      menu - the menu
      group - the group
      name - the name
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • getSqlParameters

      public Hashtable<String,Hashtable<String,Hashtable<String,String>>> getSqlParameters()
      Gets the sql parameters. Legacy method for the ECCMD daemon which is expecting some Hashtables.
      Returns:
      the sql parameters