Пример #1
0
 public static PreparedStatement prepareLoadByRegion(java.sql.Connection c) throws SQLException {
   String str =
       "select s.id, s.type, s.version from bindingscan s where "
           + " s.id in (select r.scan from bindingscanregion r where r. chromosome=? and "
           + "((r.startpos <= ? and r.stoppos >= ?) or (r.startpos >= ? and r.startpos <= ?)))";
   return c.prepareStatement(str);
 }
Пример #2
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());
  }
Пример #3
0
 public static PreparedStatement prepareLoadByLikeVersionType(java.sql.Connection c)
     throws SQLException {
   String query = "select id, type, version from " + "bindingscan where version like ? and type=?";
   return c.prepareStatement(query);
 }
Пример #4
0
 public static PreparedStatement prepareInsertExptStatement(java.sql.Connection c)
     throws SQLException {
   String str = "insert into bindingscanToExpt (scan, scanexpt, scantype) values (?, ?, ?)";
   return c.prepareStatement(str);
 }
Пример #5
0
 public static PreparedStatement prepareInsertRegionStatement(java.sql.Connection c)
     throws SQLException {
   String str =
       "insert into bindingscanregion (scan, chromosome, startpos, stoppos) values (?, ?, ?, ?)";
   return c.prepareStatement(str);
 }
Пример #6
0
 public static PreparedStatement prepareInsertParamStatement(java.sql.Connection c)
     throws SQLException {
   String str = "insert into bindingscanparam (scan, key, value) values (?, ?, ?)";
   return c.prepareStatement(str);
 }
Пример #7
0
 public static PreparedStatement prepareInsertStatement(java.sql.Connection c)
     throws SQLException {
   String str =
       "insert into bindingscan (id, type, version) values " + "(bindingscan_id.nextval, ?, ?)";
   return c.prepareStatement(str);
 }