Beispiel #1
0
 public void deleteFromDB(PreparedStatement ps) throws SQLException {
   if (dbid == -1) {
     throw new IllegalArgumentException("Can't delete non-DB OrthologyPair from DB!");
   }
   ps.setInt(1, dbid);
   ps.executeUpdate();
   dbid = -1;
 }
  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);
  }
Beispiel #3
0
 public void insertIntoDB(PreparedStatement ps, int id) throws SQLException {
   if (dbid != -1) {
     throw new IllegalArgumentException("Already in DB!");
   }
   ps.setInt(1, id);
   ps.setInt(2, mapping.getDBID());
   ps.setString(3, name1);
   ps.setInt(4, genome1.getDBID());
   ps.setString(5, name2);
   ps.setInt(6, genome2.getDBID());
   ps.executeUpdate();
   dbid = id;
 }