Package org.jugile.util

Examples of org.jugile.util.DBConnection.select()


    d.commit();
   
    // check db directly
    DBPool db = DBPool.getPool();
    DBConnection c = db.getConnection();
    List<List> rows = c.select("select name_f,id_f,vers from person_t where id_f="+p1.id());
    c.free();
    assertEquals(1,rows.size());
    List row = rows.get(0);
    assertEquals("foo",row.get(0));
    assertEquals(""+p1.id(),""+row.get(1));
View Full Code Here


    DBConnection c = db.getConnection();
    DomainData dd = DomainCore.cd();
    try {
      c.prepare("select "+_getSelectFlds()+" from "+table() +" where id_f=?");
      c.param(id());
      List<List> rows = c.select();
      if (rows.size() == 1) {
        List row = rows.get(0);
        // set state
        Bo o = origin;
        o._modified = row.get(1)==null?null:new Time((java.util.Date)row.get(1));
View Full Code Here

    DBConnection c = pool.getConnection();
    try {
      c.writeTx();
      c.prepare("select nextid from idpool where obj=?");
      c.param(obj);
      List<List> res = c.select();
      nid = (Integer)res.get(0).get(0);
      c.prepare("update idpool set nextid=? where obj=?");
      c.param(nid+idIncrement);
      c.param(obj);
      c.execute();
View Full Code Here

    List<E> res = new ArrayList<E>();
    DBPool db = DBPool.getPool();
    DBConnection c = db.getConnection();
    try {
      c.prepare(sql);
      for (List<Object> row : c.select()) {
        long id = (Integer)row.get(0);
        E o = (E)bo.createOld(bo.getClass(), id);
        o._setState(null,bo.bi(),row);
        res.add(o);
      }
View Full Code Here

      c.prepare(sql);
      c.param(node);
      c.param(NEW);
      c.param(max);
      List<Long> ids = new ArrayList<Long>();
      for (List row : c.select()) {
        long msg_id = (Integer)row.get(0);
        ids.add(msg_id);
      }
      if (ids.size() == 0) return msgs;
     
View Full Code Here

      // get messages
      sql = "select msg, nodeid, id_f, ts from dbmq_messages_t ";
      sql += "where id_f IN ("+qmarks(ids.size())+")";
      c.prepare(sql);
      for (Long id : ids) { c.param(id); }
      for (List<Object> row : c.select()) {
        String msg = (String)row.get(0);
        String nodeid = (String)row.get(1);
        long id = (Integer)row.get(2);
        Time ts = new Time((java.util.Date)row.get(3));
        Msg m = new Msg(msg);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.