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 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; }