Package de.mhus.lib.sql

Examples of de.mhus.lib.sql.DbResult


          con.commit();
      } catch (Exception e) {e.printStackTrace();}
     
      DbStatement sth = con.getStatement("select");
      try {
        DbResult res = sth.executeQuery(null);
        res.close();
      } catch (ClassNotFoundException e1) {
        System.out.println("testConnect: sql driver not found - skip test");
        return;
      } catch (SQLException e2) {
        if (e2.getMessage().startsWith("Communications link failure")) {
View Full Code Here


      HashMap<String, Object> attr = new HashMap<String, Object>();
      attr.put("text", "abc'");
      con.getStatement("insert").execute(attr);

      DbStatement sth = con.getStatement("select");
      DbResult res1 = sth.executeQuery(null);
      assertEquals(true,res1.next());
      String res2 = res1.getString("a_text");
      assertEquals(attr.get("text"), res2);
      res1.close();
     
      int res3 = con.getStatement("cleanup").executeUpdate(null);
      assertEquals(1, res3);
     
      con.commit();
View Full Code Here

      map = nameMappingRO;
    else
      map = new FallbackMap<String, Object>(attributes, nameMappingRO, true);
    try {
      DbStatement sth = con.createStatement(query);
      DbResult res = sth.executeQuery(map);
      return new DbCollection<T>(this,con,myCon != null,registryName,clazz,res);
    } catch (Throwable t) {
      throw new MException(con,query,attributes,t);
    } finally {
    // do not close, it's used by the collection
View Full Code Here

    }
   
    String tbl = config.getExtracted("table");
    DbMetadata m = ((DbApplication)getApplication()).getMetadata(tbl);
   
    DbResult res = sta.executeQuery(attributes);
    while (res.next()) {
      list.add(new DbData(this,m,res,config));
    }
    res.close();
    con.close();
  }
View Full Code Here

    int nr = 0;
    for (Object key : keys) {
      attributes.put(String.valueOf(nr), key);
      nr++;
    }
    DbResult ret = sqlPrimary.getStatement(con).executeQuery(attributes);
    if (!ret.next()) {
      ret.close();
      return null;
    }
   
    for (Feature f : features)
      f.getObject(con,ret);
View Full Code Here

    int nr = 0;
    for (Object key : keys) {
      attributes.put(String.valueOf(nr), key);
      nr++;
    }
    DbResult ret = sqlPrimary.getStatement(con).executeQuery(attributes);
    if (!ret.next()) {
      ret.close();
      return null;
    }
   
    for (Feature f : features)
      f.fillObject(obj, con, ret);

    // fill object
    for (Field f : fList) {
      f.setToTarget(ret,obj);
    }
    ret.close();
    return obj;
  }
View Full Code Here

    int nr = 0;
    for (Object key : keys) {
      attributes.put(String.valueOf(nr), key);
      nr++;
    }
    DbResult ret = sqlPrimary.getStatement(con).executeQuery(attributes);
    if (!ret.next()) {
      ret.close();
      return true;
    }
   
//    for (Feature f : features)
//      f.fillObject(obj, con, ret);

    // check object
    for (Field f : fList) {
      if (f.changed(ret,obj)) {
        ret.close();
        return true;
      }
    }
    ret.close();
    return false;
  }
View Full Code Here

        meta.getMap().add(new CaoMetaDefinition(meta, name, CaoMetaDefinition.TYPE.STRING, null, 200));
      }
     
    }
    private DbResult createResult() throws Exception {
      DbResult res = null;
      DbConnection con = ((DbCaoConnection)getConnection()).getPool().getConnection();
      DbStatement sth = con.createStatement(queryString);
      if (sth.execute(  ((DbApplication)getApplication()).getMapping() )) {
        res = sth.getResultSet();
      } else {
View Full Code Here

    public int size() {
      return -1;
    }

    private synchronized DbResult getResult() throws CaoException {
      DbResult res = null;
      if (isFirstIterator) {
        isFirstIterator = false;
        res = result;
      } else {
        try {
View Full Code Here

TOP

Related Classes of de.mhus.lib.sql.DbResult

Copyright © 2018 www.massapicom. 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.