コード例 #1
0
 public void generatorTerminalCore() {
   StringBuffer sb = new StringBuffer();
   sb.append("LOCK TABLES `tbl_terminal_core` WRITE;\r\n");
   sb.append(
       "insert into tbl_terminal_core (d_hsman_ch,d_hsman,d_hstype_ch,d_hstype,d_tac,d_gprs,d_wap,d_smartphone,d_os,d_wifi,d_createtime) values \r\n");
   HashMap<String, String> map = getTerminalCoreSQL("终端核心表_02.csv");
   Iterator it = map.keySet().iterator();
   while (it.hasNext()) {
     String key = (String) it.next();
     String sql = map.get(key);
     sb.append(sql);
   }
   sb.append("UNLOCK TABLES;");
   //		System.out.println(sb.toString());
   IOUtil.createFile(sb.toString(), "SQL_终端核心表_03" + System.currentTimeMillis());
 }
コード例 #2
0
 @Test
 public void generatorFile() {
   File file = null;
   try {
     file = new File("F:\\tmp\\split\\20110714\\");
     if (file.isDirectory()) {
       File[] subs = file.listFiles();
       int i = 0;
       for (File sub : subs) {
         String sql = getTerminalSQL(sub.getAbsolutePath());
         //					System.out.println(sql);
         System.out.println(" > " + i + " 已生成!");
         IOUtil.createFile(sql, "F:\\tmp\\split\\20110714\\result\\", "CTA_" + i);
         System.gc();
         Thread.sleep(100);
         i++;
       }
     }
     System.out.println(" >> 识别的总数:" + BCOUNT);
   } catch (Exception e) {
     e.printStackTrace();
   }
 }