前面编好了insert 语句,没有问题, 但是map里面有string 有int 请问set的时候怎么写, 用object行吗, 如果我提前把数据都转成string 全都setString 行吗 运行后报错 ORA-01008 并非所有值都是绑定的, 求教
statement = connection.createStatement();
int batchSize = 0;
for (int i = 0; i < list.size(); i++) {
int size = 1;
Map batchMap = list.get(i);
Set<Entry> entry = batchMap.entrySet();
for (Entry entry2 : entry) {
if(size < batchMap.size()){
preparedstatement.setObject(size, entry2.getValue());
size++;
}
}
statement.addBatch(sql.toString());
if(++batchSize % DB_BATCHSIZE == 0){
statement.executeBatch();
}
}