protected void deleteTempImages() throws Exception {
    if (_log.isDebugEnabled()) {
      _log.debug("Delete temporary images");
    }

    DB db = DBManagerUtil.getDB();

    db.runSQL(
        "delete from Image where imageId IN (SELECT articleImageId FROM "
            + "JournalArticleImage where tempImage = TRUE)");

    db.runSQL("delete from JournalArticleImage where tempImage = TRUE");
  }
Exemplo n.º 2
0
  protected void migrateTable(
      DB db, Connection connection, String tableName, Object[][] columns, String sqlCreate)
      throws Exception {

    Table table = new Table(tableName, columns);

    String tempFileName = table.generateTempFile();

    db.runSQL(connection, sqlCreate);

    if (tempFileName != null) {
      table.populateTable(tempFileName, connection);
    }
  }
  protected void runSQL(String template) throws IOException, SQLException {
    DB db = DBFactoryUtil.getDB();

    db.runSQL(template);
  }
  protected void runSQL(String[] sqls) throws Exception {
    DB db = DBFactoryUtil.getDB();

    db.runSQL(sqls);
  }
Exemplo n.º 5
0
  protected void executeDB(String sql) throws Exception {
    DB db = DBManagerUtil.getDB();

    db.runSQL(sql);
  }
Exemplo n.º 6
0
  public void runSQL(String[] templates) throws IOException, SQLException {
    DB db = DBFactoryUtil.getDB();

    db.runSQL(templates);
  }
Exemplo n.º 7
0
  private static void _updateCompanyKey() throws Exception {
    DB db = DBFactoryUtil.getDB();

    db.runSQL("update Company set key_ = null");
  }
Exemplo n.º 8
0
  private static void _deleteTempImages() throws Exception {
    DB db = DBFactoryUtil.getDB();

    db.runSQL(_DELETE_TEMP_IMAGES_1);
    db.runSQL(_DELETE_TEMP_IMAGES_2);
  }