コード例 #1
0
 public void close() {
   if (shouldCloseLoader && !loader.isClosed()) {
     loader.close();
   }
   DatabaseFactory.freeConnection(cxn);
   cxn = null;
   loader = null;
 }
コード例 #2
0
  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);
  }
コード例 #3
0
  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);
  }
コード例 #4
0
 public void close() {
   chipLoader.close();
   loader = null;
   closed = true;
 }
コード例 #5
0
 public boolean isClosed() {
   return loader == null || loader.isClosed();
 }