if (results == null || results.isEmpty() && log.isDebugEnabled()) log.debug("doQuery got no results for " + query);
  private static ArrayList doQuery(String query, Map substitutions) {    Logger log = CSMART.createLogger("org.cougaar.tools.csmart.ui.community.CommunityDBUtils");    ArrayList results = new ArrayList();    try {      Connection conn = DBUtils.getConnection();      try {        Statement stmt = conn.createStatement();        query = DBUtils.getQuery(query, substitutions);        // execute query that may or may not return results        if (stmt.execute(query)) {          ResultSet rs = stmt.getResultSet();          while(rs.next())             results.add(rs.getString(1));          rs.close();        }        stmt.close();      } finally {        conn.close();      }    } catch (SQLException se) {      if(log.isErrorEnabled()) {        log.error("Caught SQL exception executing query: " + query, se);      }    }     return results;  }