/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package PV; import de.nplusc.izc.tools.IOtools.DBWriter; import de.nplusc.izc.tools.IOtools.FileTK; import javax.swing.table.DefaultTableModel; /** * * @author LH */ public class UI extends javax.swing.JFrame { /** * Creates new form UI */ public UI() { initComponents(); String fp = "D:\\loa\\000010\\in.sqlite"; String fp2="D:\\loa\\000010\\out.txt"; DBWriter dbw = new DBWriter("", fp, "", "", DBWriter.DBTYPE_SQLite); //String[][] items = dbw.queryTable("SELECT url , id FROM moz_places"); String[][] idmap = dbw.queryTable("SELECT place_id , visit_date from moz_historyvisits ORDER BY visit_date"); // List l = new ArrayList<>(); StringBuilder sb = new StringBuilder(); int i=0; int j=0; int k=0; boolean c = false; // if(idmap.length>50000){c=true; // System.out.println("chunkered"); // } for (String[] ue : idmap) { String date = (new java.text.SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(new java.util.Date (Long.valueOf(ue[1])/1000))); String datafield=dbw.querySingleCell("SELECT url FROM moz_places where id = "+ue[0]); if(datafield.contains("mail.google.com")) { ((DefaultTableModel)tblT.getModel()).setValueAt(datafield, i, 0); ((DefaultTableModel)tblT.getModel()).setValueAt(date, i, 1); ((DefaultTableModel)tblT.getModel()).addRow(new String[]{""}); i++; sb.append(date).append("|").append(datafield).append("\n"); } j++; if(j%1000==0) { System.out.println(j+"/"+idmap.length); } /* if(c) { if(i%50000==0&&i!=0) { FileTK.writeFile(sb.toString(), fp2+"chunk_"+k); sb=new StringBuffer(); k++; } } */ } if(!c) { FileTK.writeFile(sb.toString(), fp2); } //dbw.closeConn(); } /** * This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); tblT = new javax.swing.JTable(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); tblT.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null} }, new String [] { "URL", "Zeitpunkt" } ) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); jScrollPane1.setViewportView(tblT); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(30, 30, 30) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 816, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(102, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 530, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(27, Short.MAX_VALUE)) ); pack(); }// /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ // /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(UI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } // /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new UI().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable tblT; // End of variables declaration }