Class ExecuteSQL

java.lang.Object
ru.bgcrm.dao.CommonDAO
org.bgerp.app.dist.inst.call.ExecuteSQL
All Implemented Interfaces:
InstallationCall

public class ExecuteSQL extends CommonDAO implements InstallationCall
Executer of SQL queries for updating DB structure. Running as InstallationCall and also directly.
  • Constructor Details

    • ExecuteSQL

      public ExecuteSQL()
  • Method Details

    • call

      public boolean call(Setup setup, File zip, String param)
      Specified by:
      call in interface InstallationCall
    • call

      public void call(Connection con, String query) throws SQLException
      Executes multiline SQL script.
      Parameters:
      con - connection.
      query - SQL script, tokenized to commands by ;.
      Throws:
      SQLException
    • doQuery

      protected void doQuery(Statement st, String query, boolean useHash, Set<String> existingHashes, Set<String> newHashes) throws SQLException
      Executes SQL query.
      Parameters:
      st - SQL statement, running the query.
      query - the query.
      useHash - use executed query hash to prevent re-execution.
      existingHashes - hashes of already applied queries.
      newHashes - set there added hash of executed query if it wasn't presented in hashes.
      Throws:
      SQLException
    • getQueryHashes

      protected Set<String> getQueryHashes(Connection con) throws SQLException
      Loads applied query hashes.
      Parameters:
      con - SQL connection.
      Returns:
      set with hashes.
      Throws:
      SQLException
    • clearHashes

      public static void clearHashes()