123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- /*
- * 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<String> 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")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">
- 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();
- }// </editor-fold>
- /**
- * @param args the command line arguments
- */
- public static void main(String args[])
- {
- /* Set the Nimbus look and feel */
- //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
- /* 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);
- }
- //</editor-fold>
- /* 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
- }
|