FileDocCategorySizeDatePackage
SQLiteQuery.javaAPI DocAndroid 5.1 API3044Thu Mar 12 22:22:10 GMT 2015android.database.sqlite

SQLiteQuery

public final class SQLiteQuery extends SQLiteProgram
Represents a query that reads the resulting rows into a {@link SQLiteQuery}. This class is used by {@link SQLiteCursor} and isn't useful itself.

This class is not thread-safe.

Fields Summary
private static final String
TAG
private final android.os.CancellationSignal
mCancellationSignal
Constructors Summary
SQLiteQuery(SQLiteDatabase db, String query, android.os.CancellationSignal cancellationSignal)


          
        super(db, query, null, cancellationSignal);

        mCancellationSignal = cancellationSignal;
    
Methods Summary
intfillWindow(android.database.CursorWindow window, int startPos, int requiredPos, boolean countAllRows)
Reads rows into a buffer.

param
window The window to fill into
param
startPos The start position for filling the window.
param
requiredPos The position of a row that MUST be in the window. If it won't fit, then the query should discard part of what it filled.
param
countAllRows True to count all rows that the query would return regardless of whether they fit in the window.
return
Number of rows that were enumerated. Might not be all rows unless countAllRows is true.
throws
SQLiteException if an error occurs.
throws
OperationCanceledException if the operation was canceled.

        acquireReference();
        try {
            window.acquireReference();
            try {
                int numRows = getSession().executeForCursorWindow(getSql(), getBindArgs(),
                        window, startPos, requiredPos, countAllRows, getConnectionFlags(),
                        mCancellationSignal);
                return numRows;
            } catch (SQLiteDatabaseCorruptException ex) {
                onCorruption();
                throw ex;
            } catch (SQLiteException ex) {
                Log.e(TAG, "exception: " + ex.getMessage() + "; query: " + getSql());
                throw ex;
            } finally {
                window.releaseReference();
            }
        } finally {
            releaseReference();
        }
    
public java.lang.StringtoString()

        return "SQLiteQuery: " + getSql();