Package jodd.db

Examples of jodd.db.DbQuery.executeUpdate()


    if (isPersistent(ded, entity) == false) {
      DbQuery q;
      if (keysGeneratedByDatabase == true) {
        q = query(insert(entity));
        q.setGeneratedKey();
        q.executeUpdate();
        long nextId = q.getGeneratedKey();
        setEntityId(ded, entity, nextId);
      } else {
        long nextId = generateNextId(ded);
        setEntityId(ded, entity, nextId);
View Full Code Here


        setEntityId(ded, entity, nextId);
      } else {
        long nextId = generateNextId(ded);
        setEntityId(ded, entity, nextId);
        q = query(insert(entity));
        q.executeUpdate();
      }
      q.close();
    } else {
      query(DbEntitySql.updateAll(entity)).autoClose().executeUpdate();
    }
View Full Code Here

      q = cleanSql(q);
      if (q.isEmpty()) {
        continue;
      }
      DbQuery query = new DbQuery(dbSession, q);
      query.executeUpdate();
      log.debug("executed query #" + (i + 1));
    }
    dbSession.closeSession();
  }
View Full Code Here

        q = StringUtil.replace(q, "$date", jdt.toString("YYYYMMDD"));
        jdt.addDay(1);
      }

      DbQuery query = new DbQuery(dbSession, q);
      query.executeUpdate();
      log.debug("executed query #" + (i + 1));
    }

    dbSession.closeSession();
  }
View Full Code Here

    DbQuery query = new DbQuery(
        "create table USER (" +
        "USER_ID  IDENTITY," +
        "NAME    varchar(20)  not null" +
        ')');
    query.executeUpdate();

    query = new DbQuery("insert into USER values(1, 'Gandalf')");
    query.executeUpdate();

    query = new DbQuery(
View Full Code Here

      DbSession session = new DbSession();

      String sql = getCreateTableSql();

      DbQuery query = new DbQuery(session, sql);
      query.executeUpdate();

      session.closeSession();
      assertTrue(query.isClosed());
    }
View Full Code Here

    protected void close() {
      DbSession session = new DbSession();

      DbQuery query = new DbQuery(session, "drop table " + getTableName());
      query.executeUpdate();

      session.closeSession();
      assertTrue(query.isClosed());

      connectionPool.close();
View Full Code Here

        "NAME    varchar(20)  not null" +
        ')');
    query.executeUpdate();

    query = new DbQuery("insert into USER values(1, 'Gandalf')");
    query.executeUpdate();

    query = new DbQuery(
        "create table WIZARD (" +
        "WIZARD_ID  IDENTITY," +
        "LEVEL    INT  not null" +
View Full Code Here

    query = new DbQuery(
        "create table WIZARD (" +
        "WIZARD_ID  IDENTITY," +
        "LEVEL    INT  not null" +
        ')');
    query.executeUpdate();

    query = new DbQuery("insert into WIZARD values(1, 7);");
    query.executeUpdate();
  }
View Full Code Here

        "LEVEL    INT  not null" +
        ')');
    query.executeUpdate();

    query = new DbQuery("insert into WIZARD values(1, 7);");
    query.executeUpdate();
  }

  @After
  public void tearDown() {
    session.closeSession();
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.