SQLite
Class TableResult

java.lang.Object
  extended bySQLite.TableResult
All Implemented Interfaces:
Callback

public class TableResult
extends Object
implements Callback

Class representing an SQLite result set as returned by the Database.get_table convenience method.

Example:

   ...
   SQLite.Database db = new SQLite.Database();
   db.open("db", 0);
   System.out.print(db.get_table("select * from TEST"));
   ...
 
Example output:
   id|firstname|lastname|
   0|John|Doe|
   1|Speedy|Gonzales|
   ...
 


Field Summary
 boolean atmaxrows
          Flag to indicate Maximum number of rows condition.
 String[] column
          Column names of the result set.
 int maxrows
          Maximum number of rows to hold in the table.
 int ncolumns
          Number of columns in the result set.
 int nrows
          Number of rows in the result set.
 Vector rows
          Rows of the result set.
 String[] types
          Types of columns of the result set or null.
 
Constructor Summary
TableResult()
          Create an empty result set.
TableResult(int maxrows)
          Create an empty result set with maximum number of rows.
 
Method Summary
 void clear()
          Clear result set.
 void columns(String[] coldata)
          Callback method used while the query is executed.
 boolean newrow(String[] rowdata)
          Callback method used while the query is executed.
 String toString()
          Make String representation of result set.
 void types(String[] types)
          Callback method used while the query is executed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

atmaxrows

public boolean atmaxrows
Flag to indicate Maximum number of rows condition.


column

public String[] column
Column names of the result set.


maxrows

public int maxrows
Maximum number of rows to hold in the table.


ncolumns

public int ncolumns
Number of columns in the result set.


nrows

public int nrows
Number of rows in the result set.


rows

public Vector rows
Rows of the result set. Each row is stored as a String array.


types

public String[] types
Types of columns of the result set or null.

Constructor Detail

TableResult

public TableResult()
Create an empty result set.


TableResult

public TableResult(int maxrows)
Create an empty result set with maximum number of rows.

Method Detail

clear

public void clear()
Clear result set.


columns

public void columns(String[] coldata)
Callback method used while the query is executed.

Specified by:
columns in interface Callback
Parameters:
coldata - string array holding the column names

newrow

public boolean newrow(String[] rowdata)
Callback method used while the query is executed.

Specified by:
newrow in interface Callback
Parameters:
rowdata - string array holding the column values of the row

toString

public String toString()
Make String representation of result set.


types

public void types(String[] types)
Callback method used while the query is executed.

Specified by:
types in interface Callback
Parameters:
types - string array holding column types


Contact: Christian Werner