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); }
/** * 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()); }
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); }
public static PreparedStatement prepareInsertExptStatement(java.sql.Connection c) throws SQLException { String str = "insert into bindingscanToExpt (scan, scanexpt, scantype) values (?, ?, ?)"; return c.prepareStatement(str); }
public static PreparedStatement prepareInsertRegionStatement(java.sql.Connection c) throws SQLException { String str = "insert into bindingscanregion (scan, chromosome, startpos, stoppos) values (?, ?, ?, ?)"; return c.prepareStatement(str); }
public static PreparedStatement prepareInsertParamStatement(java.sql.Connection c) throws SQLException { String str = "insert into bindingscanparam (scan, key, value) values (?, ?, ?)"; return c.prepareStatement(str); }
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); }