import java sql public class Ololo public static void main String args

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.sql.*;
public class Ololo {
public static void main(String args[]) {
Connection c;
Statement stmt;
try {
Class.forName("org.sqlite.JDBC");
c = DriverManager.getConnection("jdbc:sqlite:/home/azq2/main.db");
c.setAutoCommit(false);
stmt = c.createStatement();
ResultSet rs = stmt.executeQuery("SELECT datetime(timestamp, 'unixepoch') as dt, dialog_partner, author, body_xml FROM Messages LIMIT 3;");
while (rs.next()) {
System.out.println("time = " + rs.getString("dt"));
System.out.println("author = " + rs.getString("author"));
System.out.println("dialog_partner = " + rs.getString("dialog_partner"));
System.out.println("body_xml = " + rs.getString("body_xml"));
System.out.println();
}
stmt.close();
c.close();
} catch ( Exception e ) {
e.printStackTrace();
System.exit(0);
}
System.out.println("Opened database successfully");
}
}