2019-03-19 15:41:21,768 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) DEBUG - INSERT INTO webmaster_basetable_crc_error(data_time,device_name,network_name,device_ip,crc_code) VALUES(?,?,?,?,?)
| 1 | 2 | 3 | 4 | 5 |
|---------------------|---------------------------------|-----------------------|-------------|------|
| 2019-03-19 14:00:00 | New-JLCC-PA-CMNET-RT06-NE5KE-PY | NULL0 | 111.26.25.8 | NULL |
| 2019-03-19 14:00:00 | New-JLCC-PA-CMNET-RT06-NE5KE-PY | LoopBack0 | 111.26.25.8 | NULL |
| 2019-03-19 14:00:00 | New-JLCC-PA-CMNET-RT06-NE5KE-PY | InLoopBack0 | 111.26.25.8 | NULL |
| 2019-03-19 14:00:00 | New-JLCC-PA-CMNET-RT06-NE5KE-PY | GigabitEthernet3/1/9 | 111.26.25.8 | 0.0 |
| 2019-03-19 14:00:00 | New-JLCC-PA-CMNET-RT06-NE5KE-PY | GigabitEthernet3/1/8 | 111.26.25.8 | 0.0 |
| 2019-03-19 14:00:00 | New-JLCC-PA-CMNET-RT06-NE5KE-PY | GigabitEthernet3/1/7 | 111.26.25.8 | 0.0 |
| 2019-03-19 14:00:00 | New-JLCC-PA-CMNET-RT06-NE5KE-PY | GigabitEthernet3/1/6 | 111.26.25.8 | 0.0 |
| 2019-03-19 14:00:00 | New-JLCC-PA-CMNET-RT06-NE5KE-PY | GigabitEthernet3/1/5 | 111.26.25.8 | 0.0 |
| 2019-03-19 14:00:00 | New-JLCC-PA-CMNET-RT06-NE5KE-PY | GigabitEthernet3/1/4 | 111.26.25.8 | 0.0 |
| 2019-03-19 14:00:00 | New-JLCC-PA-CMNET-RT06-NE5KE-PY | GigabitEthernet3/1/3 | 111.26.25.8 | 0.0 |
-- Only display first 10 lines , don't show the remaining record(count=39)
For example:> "INSERT INTO webmaster_basetable_crc_error(data_time,device_name,network_name,device_ip,crc_code) VALUES('2019-03-19 14:00:00','New-JLCC-PA-CMNET-RT06-NE5KE-PY','NULL0','111.26.25.8',NULL) "
for (int j = 0; j < array.size(); j++) {
port = new StringBuffer(Util
.reBuildJSONObject(array.get(j).toString()).get("key")
.toString());
if (Util.reBuildJSONObject(
Util.reBuildJSONObject(array.get(j).toString())
.get("1").toString()).size() == 0) {
sql = "insert into " + TABLE
+ " (data_time,device_name,network_name,device_ip)"
+ " values('" + realTime + "','" + device_name
+ "','" + port + "','" + device_ip + "')";
cc = new Crc_Code();
cc.setData_time(realTime);
cc.setDevice_name(device_name);
cc.setNetwork_name(port.toString());
cc.setDevice_ip(device_ip);
} else {
crc_code = new StringBuffer(Util
.reBuildJSONObject(
Util.reBuildJSONObject(
array.get(j).toString()).get("1")
.toString()).get("value")
.toString());
sql = "insert into "
+ TABLE
+ " (data_time,device_name,network_name,device_ip,crc_code)"
+ " values('" + realTime + "','" + device_name
+ "','" + port + "','" + device_ip + "',"
+ crc_code + ")";
cc = new Crc_Code();
cc.setData_time(realTime);
cc.setDevice_name(device_name);
cc.setNetwork_name(port.toString());
cc.setDevice_ip(device_ip);
cc.setCrc_code(Double.parseDouble(crc_code.toString()));
}
try {
allList.add(cc);
} catch (Exception e) {
e.printStackTrace();
System.err.println(sql);
}
}
daoZC.fastInsert(allList);