private void execute(String sql, boolean ddl) {
   Prepared command = session.prepare(sql);
   command.update();
   if (ddl) {
     session.commit(true);
   }
 }
 private void checkNoNullValues() {
   String sql =
       "SELECT COUNT(*) FROM " + table.getSQL() + " WHERE " + oldColumn.getSQL() + " IS NULL";
   Prepared command = session.prepare(sql);
   ResultInterface result = command.query(0);
   result.next();
   if (result.currentRow()[0].getInt() > 0) {
     throw DbException.get(ErrorCode.COLUMN_CONTAINS_NULL_VALUES_1, oldColumn.getSQL());
   }
 }
  /** @param qry Query. */
  private void checkQuery(String qry) throws Exception {
    Prepared prepared = parse(qry);

    GridSqlQuery gQry = new GridSqlQueryParser().parse(prepared);

    String res = gQry.getSQL();

    System.out.println(normalizeSql(res));

    assertSqlEquals(prepared.getPlanSQL(), res);
  }
示例#4
0
 @Override
 public void setCommand(Command command) {
   super.setCommand(command);
   if (query != null) {
     query.setCommand(command);
   }
 }