public static void insertRecords(final HConnection connection,
final int cnt,
final String msg) throws HBqlException {
HPreparedStatement stmt = connection.prepareStatement(
"insert into tab2 "
+ "(keyval, val1, val2, val5, val6, f3mapval1, f3mapval2, val8) values "
+ "(:key, :val1, :val2, :val5, :val6, :f3mapval1, :f3mapval2, :val8)");
for (int i = 0; i < cnt; i++) {
final String keyval = Util.getZeroPaddedNonNegativeNumber(i, TestSupport.keywidth);
keyList.add(keyval);
int val5 = randomVal.nextInt();
String s_val5 = "" + val5;
val1List.add(s_val5);
val5List.add(val5);
Map<String, String> mapval1 = Maps.newHashMap();
mapval1.put("mapcol1", "mapcol1 val" + i + " " + msg);
mapval1.put("mapcol2", "mapcol2 val" + i + " " + msg);
Map<String, String> mapval2 = Maps.newHashMap();
mapval2.put("mapcol1-b", "mapcol1-b val" + i + " " + msg);
mapval2.put("mapcol2-b", "mapcol2-b val" + i + " " + msg);
mapval2.put("mapcol3-b", "mapcol3-b val" + i + " " + msg);
int[] intv1 = new int[5];
val8check = new int[5];
for (int j = 0; j < intv1.length; j++) {
intv1[j] = j * 10;
val8check[j] = intv1[j];
}
stmt.setParameter("key", keyval);
stmt.setParameter("val1", s_val5);
stmt.setParameter("val2", s_val5 + " " + msg);
stmt.setParameter("val5", val5);
stmt.setParameter("val6", i * 100);
stmt.setParameter("f3mapval1", mapval1);
stmt.setParameter("f3mapval2", mapval2);
stmt.setParameter("val8", intv1);
stmt.execute();
}
}