4 * Callback interface for SQLite's query results.
9 * class TableFmt implements SQLite.Callback {
10 * public void columns(String cols[]) {
11 * System.out.println("<TH><TR>");
12 * for (int i = 0; i < cols.length; i++) {
13 * System.out.println("<TD>" + cols[i] + "</TD>");
15 * System.out.println("</TR></TH>");
17 * public boolean newrow(String cols[]) {
18 * System.out.println("<TR>");
19 * for (int i = 0; i < cols.length; i++) {
20 * System.out.println("<TD>" + cols[i] + "</TD>");
22 * System.out.println("</TR>");
27 * SQLite.Database db = new SQLite.Database();
29 * System.out.println("<TABLE>");
30 * db.exec("select * from TEST", new TableFmt());
31 * System.out.println("</TABLE>");
36 public interface Callback {
39 * Reports column names of the query result.
40 * This method is invoked first (and once) when
41 * the SQLite engine returns the result set.<BR><BR>
43 * @param coldata string array holding the column names
46 public void columns(String coldata[]);
49 * Reports type names of the columns of the query result.
50 * This is available from SQLite 2.6.0 on and needs
51 * the PRAGMA show_datatypes to be turned on.<BR><BR>
53 * @param types string array holding column types
56 public void types(String types[]);
59 * Reports row data of the query result.
60 * This method is invoked for each row of the
61 * result set. If true is returned the running
62 * SQLite query is aborted.<BR><BR>
64 * @param rowdata string array holding the column values of the row
67 public boolean newrow(String rowdata[]);