public interface Callback
class TableFmt implements SQLite.Callback {
public void columns(String cols[]) {
System.out.println("<TH><TR>");
for (int i = 0; i < cols.length; i++) {
System.out.println("<TD>" + cols[i] + "</TD>");
}
System.out.println("</TR></TH>");
}
public boolean newrow(String cols[]) {
System.out.println("<TR>");
for (int i = 0; i < cols.length; i++) {
System.out.println("<TD>" + cols[i] + "</TD>");
}
System.out.println("</TR>");
return false;
}
}
...
SQLite.Database db = new SQLite.Database();
db.open("db", 0);
System.out.println("<TABLE>");
db.exec("select * from TEST", new TableFmt());
System.out.println("</TABLE>");
...
void columns(String[] coldata)
coldata - string array holding the column namesvoid types(String[] types)
types - string array holding column typesboolean newrow(String[] rowdata)
rowdata - string array holding the column values of the rowCopyright © 2014. All rights reserved.