public void close() {
   if (shouldCloseLoader && !loader.isClosed()) {
     loader.close();
   }
   DatabaseFactory.freeConnection(cxn);
   cxn = null;
   loader = null;
 }
  public Collection<ExptCondition> getAllConditions() throws SQLException {
    LinkedList<Integer> conds = new LinkedList<Integer>();
    Statement s = cxn.createStatement();
    ResultSet rs = s.executeQuery("select distinct(e.condition) from experiment e");

    while (rs.next()) {
      conds.add(rs.getInt(1));
    }

    rs.close();
    s.close();

    return loader.loadAllExptConditions(conds);
  }
 public boolean isClosed() {
   return loader == null || loader.isClosed();
 }