Пример #1
0
  /**
   * insertIntoDB is called by the BindingScanLoader object, when it wants to put this BindingScan
   * into the database. Users who want to insert a BindingScan object should call the
   * BindingScanLoader.insertScan() method.
   *
   * @param c
   * @param genomeMap
   * @param ps
   * @param paramps
   * @param regionps
   * @throws SQLException
   */
  void insertIntoDB(java.sql.Connection c, BindingScanGenomeMap genomeMap, PreparedStatement ps)
      throws SQLException {

    if (dbid != -1) {
      throw new IllegalArgumentException();
    }

    ps.setString(1, type);
    ps.setString(2, version);

    ps.executeUpdate();

    Statement s = c.createStatement();
    ResultSet rs = s.executeQuery("select bindingscan_id.currval from dual");
    if (rs.next()) {
      dbid = rs.getInt(1);
    }
    rs.close();
    s.close();

    genomeMap.insertNewMapping(c, dbid, genome.getDBID());
  }