|
|
|
@ -122,8 +122,8 @@ public class DML {
|
|
|
|
|
return execInsertedPreparedStatementByItem(dialect, conn, table, ps, rowCount, tableColName, tableColType, tableValue); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (int rownum=0; rownum<rowCount; rownum++) { |
|
|
|
|
for (int index=0; index<tableColName.size(); index++) { |
|
|
|
|
for (int rownum = 0; rownum < rowCount; rownum++) { |
|
|
|
|
for (int index = 0; index < tableColName.size(); index++) { |
|
|
|
|
int type = tableColType.get(index); |
|
|
|
|
Object value = tableValue.get(tableColName.get(index)).get(rownum); |
|
|
|
|
// excel 中读数 1 会识别为 1.0 , 列格式为[文本]时需要调整下
|
|
|
|
@ -131,21 +131,26 @@ public class DML {
|
|
|
|
|
value = value.toString().split("\\.")[0]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DBUtils.applyColumnTypeValue( |
|
|
|
|
dialect, |
|
|
|
|
conn, |
|
|
|
|
table, |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
ps, |
|
|
|
|
index + 1, |
|
|
|
|
type, |
|
|
|
|
value |
|
|
|
|
); |
|
|
|
|
try { |
|
|
|
|
DBUtils.applyColumnTypeValue( |
|
|
|
|
dialect, |
|
|
|
|
conn, |
|
|
|
|
table, |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
ps, |
|
|
|
|
index + 1, |
|
|
|
|
type, |
|
|
|
|
value |
|
|
|
|
); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
// 类型推断后,若遇到不符合该类型的值,直接catch错误
|
|
|
|
|
FineLoggerFactory.getLogger().warn("type is not match"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
count ++ ; |
|
|
|
|
ps.addBatch(); |
|
|
|
|
if(rownum!=0 && rownum%10000==0){ |
|
|
|
|
if(rownum != 0 && rownum % 10000 == 0){ |
|
|
|
|
ps.executeBatch(); |
|
|
|
|
ps.clearBatch(); |
|
|
|
|
} |
|
|
|
|