Methods Summary |
---|
public void | bindDouble(int index, double value)
mBindArgs[index - 1] = Double.toString(value);
if (!mClosed) super.bindDouble(index, value);
|
public void | bindLong(int index, long value)
mBindArgs[index - 1] = Long.toString(value);
if (!mClosed) super.bindLong(index, value);
|
public void | bindNull(int index)
mBindArgs[index - 1] = null;
if (!mClosed) super.bindNull(index);
|
public void | bindString(int index, java.lang.String value)
mBindArgs[index - 1] = value;
if (!mClosed) super.bindString(index, value);
|
public void | close()
super.close();
mClosed = true;
|
int | columnCountLocked()Get the column count for the statement. Only valid on query based
statements. The database must be locked
when calling this method.
acquireReference();
try {
return native_column_count();
} finally {
releaseReference();
}
|
java.lang.String | columnNameLocked(int columnIndex)Retrieves the column name for the given column index. The database must be locked
when calling this method.
acquireReference();
try {
return native_column_name(columnIndex);
} finally {
releaseReference();
}
|
int | fillWindow(android.database.CursorWindow window, int maxRead, int lastPos)Reads rows into a buffer. This method acquires the database lock.
mDatabase.lock();
boolean logStats = mDatabase.mLogStats;
long startTime = logStats ? SystemClock.elapsedRealtime() : 0;
try {
acquireReference();
try {
window.acquireReference();
// if the start pos is not equal to 0, then most likely window is
// too small for the data set, loading by another thread
// is not safe in this situation. the native code will ignore maxRead
int numRows = native_fill_window(window, window.getStartPosition(), mOffsetIndex,
maxRead, lastPos);
// Logging
if (SQLiteDebug.DEBUG_SQL_STATEMENTS) {
Log.d(TAG, "fillWindow(): " + mQuery);
}
if (logStats) {
mDatabase.logTimeStat(true /* read */, startTime,
SystemClock.elapsedRealtime());
}
return numRows;
} catch (IllegalStateException e){
// simply ignore it
return 0;
} catch (SQLiteDatabaseCorruptException e) {
mDatabase.onCorruption();
throw e;
} finally {
window.releaseReference();
}
} finally {
releaseReference();
mDatabase.unlock();
}
|
private final native int | native_column_count()
|
private final native java.lang.String | native_column_name(int columnIndex)
|
private final native int | native_fill_window(android.database.CursorWindow window, int startPos, int offsetParam, int maxRead, int lastPos)
|
void | requery()Called by SQLiteCursor when it is requeried.
if (mBindArgs != null) {
int len = mBindArgs.length;
try {
for (int i = 0; i < len; i++) {
super.bindString(i + 1, mBindArgs[i]);
}
} catch (SQLiteMisuseException e) {
StringBuilder errMsg = new StringBuilder("mQuery " + mQuery);
for (int i = 0; i < len; i++) {
errMsg.append(" ");
errMsg.append(mBindArgs[i]);
}
errMsg.append(" ");
IllegalStateException leakProgram = new IllegalStateException(
errMsg.toString(), e);
throw leakProgram;
}
}
|
public java.lang.String | toString()
return "SQLiteQuery: " + mQuery;
|