SQLiteStatementpublic final class SQLiteStatement extends SQLiteProgram Represents a statement that can be executed against a database. The statement
cannot return multiple rows or columns, but single value (1 x 1) result sets
are supported.
This class is not thread-safe.
|
Methods Summary |
---|
public void | execute()Execute this SQL statement, if it is not a SELECT / INSERT / DELETE / UPDATE, for example
CREATE / DROP table, view, trigger, index etc.
acquireReference();
try {
getSession().execute(getSql(), getBindArgs(), getConnectionFlags(), null);
} catch (SQLiteDatabaseCorruptException ex) {
onCorruption();
throw ex;
} finally {
releaseReference();
}
| public long | executeInsert()Execute this SQL statement and return the ID of the row inserted due to this call.
The SQL statement should be an INSERT for this to be a useful call.
acquireReference();
try {
return getSession().executeForLastInsertedRowId(
getSql(), getBindArgs(), getConnectionFlags(), null);
} catch (SQLiteDatabaseCorruptException ex) {
onCorruption();
throw ex;
} finally {
releaseReference();
}
| public int | executeUpdateDelete()Execute this SQL statement, if the the number of rows affected by execution of this SQL
statement is of any importance to the caller - for example, UPDATE / DELETE SQL statements.
acquireReference();
try {
return getSession().executeForChangedRowCount(
getSql(), getBindArgs(), getConnectionFlags(), null);
} catch (SQLiteDatabaseCorruptException ex) {
onCorruption();
throw ex;
} finally {
releaseReference();
}
| public android.os.ParcelFileDescriptor | simpleQueryForBlobFileDescriptor()Executes a statement that returns a 1 by 1 table with a blob value.
acquireReference();
try {
return getSession().executeForBlobFileDescriptor(
getSql(), getBindArgs(), getConnectionFlags(), null);
} catch (SQLiteDatabaseCorruptException ex) {
onCorruption();
throw ex;
} finally {
releaseReference();
}
| public long | simpleQueryForLong()Execute a statement that returns a 1 by 1 table with a numeric value.
For example, SELECT COUNT(*) FROM table;
acquireReference();
try {
return getSession().executeForLong(
getSql(), getBindArgs(), getConnectionFlags(), null);
} catch (SQLiteDatabaseCorruptException ex) {
onCorruption();
throw ex;
} finally {
releaseReference();
}
| public java.lang.String | simpleQueryForString()Execute a statement that returns a 1 by 1 table with a text value.
For example, SELECT COUNT(*) FROM table;
acquireReference();
try {
return getSession().executeForString(
getSql(), getBindArgs(), getConnectionFlags(), null);
} catch (SQLiteDatabaseCorruptException ex) {
onCorruption();
throw ex;
} finally {
releaseReference();
}
| public java.lang.String | toString()
return "SQLiteProgram: " + getSql();
|
|