Build 1.0_r1(from source)

android.database.sqlite
Class SQLiteQuery

java.lang.Object
  extended by android.database.sqlite.SQLiteClosable
      extended by android.database.sqlite.SQLiteProgram
          extended by android.database.sqlite.SQLiteQuery

public class SQLiteQuery
extends SQLiteProgram

A SQLite program that represents a query that reads the resulting rows into a CursorWindow. This class is used by SQLiteCursor and isn't useful itself.


Field Summary
 
Fields inherited from class android.database.sqlite.SQLiteProgram
mDatabase, nHandle, nStatement, TAG
 
Constructor Summary
SQLiteQuery(SQLiteDatabase db, String query, int offsetIndex, String[] bindArgs)
          Create a persistent query object.
 
Method Summary
 void bindDouble(int index, double value)
          Bind a double value to this statement.
 void bindLong(int index, long value)
          Bind a long value to this statement.
 void bindNull(int index)
          Bind a NULL value to this statement.
 void bindString(int index, String value)
          Bind a String value to this statement.
 void close()
          Release this program's resources, making it invalid.
(package private)  int columnCountLocked()
          Get the column count for the statement.
(package private)  String columnNameLocked(int columnIndex)
          Retrieves the column name for the given column index.
(package private)  int fillWindow(CursorWindow window, int startPos)
          Reads rows into a buffer.
(package private)  void requery()
          Called by SQLiteCursor when it is requeried.
 
Methods inherited from class android.database.sqlite.SQLiteProgram
bindBlob, clearBindings, compile, finalize, getUniqueId, native_bind_blob, native_bind_double, native_bind_long, native_bind_null, native_bind_string, native_compile, native_finalize, onAllReferencesReleased, onAllReferencesReleasedFromContainer
 
Methods inherited from class android.database.sqlite.SQLiteClosable
acquireReference, releaseReference, releaseReferenceFromContainer
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLiteQuery

SQLiteQuery(SQLiteDatabase db,
            String query,
            int offsetIndex,
            String[] bindArgs)
Create a persistent query object.

Parameters:
db - The database that this query object is associated with
query - The SQL string for this query. It must include "INDEX -1 OFFSET ?" at the end
offsetIndex - The 1-based index to the OFFSET parameter
Method Detail

fillWindow

int fillWindow(CursorWindow window,
               int startPos)
Reads rows into a buffer. This method acquires the database lock.

Parameters:
window - The window to fill into
startPos - The position to start reading rows from
Returns:
number of total rows in the query

columnCountLocked

int columnCountLocked()
Get the column count for the statement. Only valid on query based statements. The database must be locked when calling this method.

Returns:
The number of column in the statement's result set.

columnNameLocked

String columnNameLocked(int columnIndex)
Retrieves the column name for the given column index. The database must be locked when calling this method.

Parameters:
columnIndex - the index of the column to get the name for
Returns:
The requested column's name

close

public void close()
Description copied from class: SQLiteProgram
Release this program's resources, making it invalid.

Overrides:
close in class SQLiteProgram

requery

void requery()
Called by SQLiteCursor when it is requeried.


bindNull

public void bindNull(int index)
Description copied from class: SQLiteProgram
Bind a NULL value to this statement. The value remains bound until SQLiteProgram.clearBindings() is called.

Overrides:
bindNull in class SQLiteProgram
Parameters:
index - The 1-based index to the parameter to bind null to

bindLong

public void bindLong(int index,
                     long value)
Description copied from class: SQLiteProgram
Bind a long value to this statement. The value remains bound until SQLiteProgram.clearBindings() is called.

Overrides:
bindLong in class SQLiteProgram
Parameters:
index - The 1-based index to the parameter to bind
value - The value to bind

bindDouble

public void bindDouble(int index,
                       double value)
Description copied from class: SQLiteProgram
Bind a double value to this statement. The value remains bound until SQLiteProgram.clearBindings() is called.

Overrides:
bindDouble in class SQLiteProgram
Parameters:
index - The 1-based index to the parameter to bind
value - The value to bind

bindString

public void bindString(int index,
                       String value)
Description copied from class: SQLiteProgram
Bind a String value to this statement. The value remains bound until SQLiteProgram.clearBindings() is called.

Overrides:
bindString in class SQLiteProgram
Parameters:
index - The 1-based index to the parameter to bind
value - The value to bind

Build 1.0_r1(from source)

Please submit a feedback, bug or feature