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");
  }
Пример #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);
  }
Пример #5
0
  protected void executeDB(String sql) throws Exception {
    DB db = DBManagerUtil.getDB();

    db.runSQL(sql);
  }
Пример #6
0
  public void runSQL(String[] templates) throws IOException, SQLException {
    DB db = DBFactoryUtil.getDB();

    db.runSQL(templates);
  }
Пример #7
0
  private static void _updateCompanyKey() throws Exception {
    DB db = DBFactoryUtil.getDB();

    db.runSQL("update Company set key_ = null");
  }
Пример #8
0
  private static void _deleteTempImages() throws Exception {
    DB db = DBFactoryUtil.getDB();

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