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 CellLine getCells(Experiment expt) throws SQLException, UnknownRoleException { java.sql.Connection cxn = loader.getConnection(); PreparedStatement ps = cxn.prepareStatement("select cells from experiment" + " where id=?"); ps.setInt(1, expt.getDBID()); ResultSet rs = ps.executeQuery(); int cellsID = -1; if (rs.next()) { cellsID = rs.getInt(1); } rs.close(); ps.close(); return chipLoader.loadCellLine(cellsID); }
public void close() { chipLoader.close(); loader = null; closed = true; }
public boolean isClosed() { return loader == null || loader.isClosed(); }