制造测试数据

造数据

 


try{

String sql = " INSERT INTO `agent_info` VALUES ('1bd12d8aafd6b58ff291ba4255dc27de', NULL, NULL, '4b236df2ea5908473a4ab548f89725a4', '2020-05-12 13:47:40', 4, '厂商', '3701001', '10000000001', '李大国', '18799990000', '备注信息');";
String fileName = "E:\\agent.sql";
File f=new File(fileName);
FileWriter fw = new FileWriter(f, true);
PrintWriter pw = new PrintWriter(fw);

int from = 1;
int to = 30;

for(int i = from;i<to;i++){
sql = " INSERT INTO `agent_info` VALUES ('AGENT"+i+"', NULL, NULL, '4b236df2ea5908473a4ab548f89725a4', '2020-5-28 16:39:04', 4, '设备厂商-"+i+"', '37010010"+i+"', '10000000"+i+"', '李大"+i+"', '18799990000', '备注信息"+i+"');";
pw.println( sql );
//System.out.println(sql);
}

pw.flush();
fw.flush();
pw.close();
fw.close();
}catch (Exception e){
e.printStackTrace();
}finally {

System.out.println("xxxxxx");
}

 

posted @ 2020-05-28 10:44  Devan.Yan  阅读(269)  评论(0编辑  收藏  举报