Examples of batchUpdate()


Examples of net.hasor.db.jdbc.core.JdbcTemplate.batchUpdate()

            batchValues[i].put("Account", String.format("acc_%s", i));
            batchValues[i].put("Pwd", String.format("pwd_%s", i));
            batchValues[i].put("Email", String.format("autoUser_%s@hasor.net", i));
            batchValues[i].put("RegTime", new Date());
        }
        jdbc.batchUpdate(batchInsert, batchValues);//批量执行执行插入语句
        HasorUnit.printMapList(jdbc.queryForList("select * from TB_User"));
        //
        showUserCount(jdbc);//显示当前用户总数
    }
    private void showUserCount(JdbcTemplate jdbc) throws SQLException {
View Full Code Here

Examples of net.paoding.rose.jade.dataaccess.DataAccess.batchUpdate()

                    runtime.getMetaData(), runtime.getProperties());
            List<Object[]> argsList = new ArrayList<Object[]>(batchRuntimes.size());
            for (StatementRuntime batchRuntime : batchRuntimes) {
                argsList.add(batchRuntime.getArgs());
            }
            int[] batchResult = dataAccess.batchUpdate(sql, argsList);
            if (batchs.size() == 1) {
                updatedArray = batchResult;
            } else {
                int index_at_sub_batch = 0;
                for (StatementRuntime batchRuntime : batchRuntimes) {
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.HRegion.batchUpdate()

    byte [] keyToWrite = startKey == null ? Bytes.toBytes("row_000") : startKey;
   
    BatchUpdate bu = new BatchUpdate(keyToWrite);
    bu.put(COLUMN_NAME, "test".getBytes());

    region.batchUpdate(bu, null);

    region.close();
    region.getLog().closeAndDelete();
    return region;
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.HRegion.batchUpdate()

    for(int i = firstRow; i < firstRow + nrows; i++) {
      BatchUpdate batchUpdate = new BatchUpdate(Bytes.toBytes("row_"
          + String.format("%1$05d", i)));

      batchUpdate.put(COLUMN_NAME, value.get());
      region.batchUpdate(batchUpdate, null);
      if(i % 10000 == 0) {
        System.out.println("Flushing write #" + i);
        r.flushcache();
      }
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.HRegion.batchUpdate()

    byte [] keyToWrite = startKey == null ? Bytes.toBytes("row_000") : startKey;
   
    BatchUpdate bu = new BatchUpdate(keyToWrite);
    bu.put(COLUMN_NAME, "test".getBytes());

    region.batchUpdate(bu);

    region.close();
    region.getLog().closeAndDelete();
    return region;
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.HRegion.batchUpdate()

    for(int i = firstRow; i < firstRow + nrows; i++) {
      BatchUpdate batchUpdate = new BatchUpdate(Bytes.toBytes("row_"
          + String.format("%1$05d", i)));

      batchUpdate.put(COLUMN_NAME, value.get());
      region.batchUpdate(batchUpdate);
      if(i % 10000 == 0) {
        System.out.println("Flushing write #" + i);
        r.flushcache();
      }
    }
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.HRegion.batchUpdate()

    byte [] keyToWrite = startKey == null ? Bytes.toBytes("row_000") : startKey;
   
    BatchUpdate bu = new BatchUpdate(keyToWrite);
    bu.put(COLUMN_NAME, "test".getBytes());

    region.batchUpdate(bu, null);

    region.close();
    region.getLog().closeAndDelete();
    return region;
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.regionserver.HRegion.batchUpdate()

    for(int i = firstRow; i < firstRow + nrows; i++) {
      BatchUpdate batchUpdate = new BatchUpdate(Bytes.toBytes("row_"
          + String.format("%1$05d", i)));

      batchUpdate.put(COLUMN_NAME, value.get());
      region.batchUpdate(batchUpdate, null);
      if(i % 10000 == 0) {
        System.out.println("Flushing write #" + i);
        r.flushcache();
      }
    }
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.batchUpdate()

    final String noCommentSql[] = removeCommentsAndSemicolons(connectionModel.getSchema(), sql);
    try {
      // run the code in a transaction
      txTemplate.execute(new TransactionCallbackWithoutResult() {
        public void doInTransactionWithoutResult(TransactionStatus status) {
          jt.batchUpdate(noCommentSql);
        }
      });
    } catch (DataAccessException e) {
      if (logger.isErrorEnabled()) {
        logger.error("data access exception", e);
View Full Code Here

Examples of org.springframework.jdbc.core.JdbcTemplate.batchUpdate()

      for(String sql : statements) {
        if(sql != null && sql.trim().length() > 0)
          listStatements.add(sql);
      }
      JdbcTemplate jt = new JdbcTemplate(this.getDataSource());
      jt.batchUpdate(listStatements.toArray(new String[]{}));
    }
  }

  /*
   * (non-Javadoc)
 
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.