if(!old_analysis_name.equals(analysis_name)){ countsForAnalysis = new HashMap(); returnMap.put(analysis_name, countsForAnalysis);
if( job_status.equals(ModelElement.SUBMITTED) || job_status.equals(ModelElement.FAILED) || job_status.equals(ModelElement.RUNNING) ){ if(!old_analysis_name.equals(analysis_name)){ countsForAnalysis = new HashMap(); returnMap.put(analysis_name, countsForAnalysis); } if(job_status.equals(ModelElement.RUNNING)){ countsForAnalysis.put(ModelElement.RUNNING, new Integer(count)); }else if(job_status.equals(ModelElement.FAILED)){ countsForAnalysis.put(ModelElement.FAILED, new Integer(count)); }else if(job_status.equals(ModelElement.SUBMITTED)){ countsForAnalysis.put(ModelElement.SUBMITTED, new Integer(count)); }
  protected HashMap getCurrentlyRunningJobStatuses(Statement statement) throws SQLException{    String analysis_name;    String old_analysis_name;    String job_status;    int count;    HashMap returnMap = new HashMap();    HashMap countsForAnalysis = null;    String select =       (new StringBuffer())        .append("select analysis.logic_name, job_status.status, count(*)  ")        .append("from analysis, job_status, job ")        .append("where job.job_id = job_status.job_id and ")        .append("analysis.analysis_id = job.analysis_id and  ")        .append("job_status.is_current = 'y' ")        .append("group by analysis.logic_name, job_status.status ")        .append("order by analysis.logic_name")        .toString();     ResultSet resultSet = statement.executeQuery(select);    old_analysis_name = "";        while(resultSet.next()){      analysis_name = resultSet.getString(1);      job_status = resultSet.getString(2);      count = resultSet.getInt(3);            if(!old_analysis_name.equals(analysis_name)){        countsForAnalysis = new HashMap();        returnMap.put(analysis_name, countsForAnalysis);      }            countsForAnalysis.put(job_status, new Integer(count));    }    return returnMap;  }