2021-02-19 15:20
@zzutligang
//检测表是否存在
String selectDbName = "select database() as dbName";
Map DbNameMap = JdbcUtil.queryForOneMap(logConn,selectDbName,"testSql");
Object dbName = DbNameMap.get("dbName");
String sql = "select table_name from Information_schema.tables where table_Name = 'logs_" + index + "'" + "and TABLE_SCHEMA='"+ dbName.toString() +"'";
Map tableName = JdbcUtil.queryForOneMap(logConn,sql,"testSql");
if (tableName == null){
iterator.remove();
}
已经解决了,谢谢
2021-01-27 20:00
@杜福忠 我写了个定时任务,然后通过
ArrayList sqlList = new ArrayList<>();
sqlList.add(sql);
Db.batch(sqlList,sqlList.size());这种方式实现