Class SQLiteStatement
-
- All Implemented Interfaces:
-
androidx.sqlite.db.SupportSQLiteProgram,androidx.sqlite.db.SupportSQLiteStatement,java.io.Closeable,java.lang.AutoCloseable
public final class SQLiteStatement extends SQLiteProgram implements SupportSQLiteStatement
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.
-
-
Method Summary
Modifier and Type Method Description voidexecuteRaw()Execute this SQL statement, if it is not a SELECT / INSERT / DELETE / UPDATE, for example CREATE / DROP table, view, trigger, index etc. voidexecute()Execute this SQL statement, if it is not a SELECT / INSERT / DELETE / UPDATE, for example CREATE / DROP table, view, trigger, index etc. intexecuteUpdateDelete()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. longexecuteInsert()Execute this SQL statement and return the ID of the row inserted due to this call. longsimpleQueryForLong()Execute a statement that returns a 1 by 1 table with a numeric value. StringsimpleQueryForString()Execute a statement that returns a 1 by 1 table with a text value. ParcelFileDescriptorsimpleQueryForBlobFileDescriptor()Executes a statement that returns a 1 by 1 table with a blob value. StringtoString()-
Methods inherited from class net.zetetic.database.sqlcipher.SQLiteProgram
bindAllArgs, bindAllArgsAsStrings, bindBlob, bindDouble, bindLong, bindNull, bindString, clearBindings, getUniqueId -
Methods inherited from class net.zetetic.database.sqlcipher.SQLiteClosable
acquireReference, close, releaseReference, releaseReferenceFromContainer -
Methods inherited from class androidx.sqlite.db.SupportSQLiteProgram
bindBlob, bindDouble, bindLong, bindNull, bindString, clearBindings -
Methods inherited from class java.io.Closeable
close -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
executeRaw
void executeRaw()
Execute this SQL statement, if it is not a SELECT / INSERT / DELETE / UPDATE, for example CREATE / DROP table, view, trigger, index etc.
-
execute
void execute()
Execute this SQL statement, if it is not a SELECT / INSERT / DELETE / UPDATE, for example CREATE / DROP table, view, trigger, index etc.
-
executeUpdateDelete
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.
- Returns:
the number of rows affected by this SQL statement execution.
-
executeInsert
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.
- Returns:
the row ID of the last row inserted, if this insert is successful. -1 otherwise.
-
simpleQueryForLong
long simpleQueryForLong()
Execute a statement that returns a 1 by 1 table with a numeric value. For example, SELECT COUNT(*) FROM table;
- Returns:
The result of the query.
-
simpleQueryForString
String simpleQueryForString()
Execute a statement that returns a 1 by 1 table with a text value. For example, SELECT COUNT(*) FROM table;
- Returns:
The result of the query.
-
simpleQueryForBlobFileDescriptor
ParcelFileDescriptor simpleQueryForBlobFileDescriptor()
Executes a statement that returns a 1 by 1 table with a blob value.
- Returns:
A read-only file descriptor for a copy of the blob value, or
nullif the value is null or could not be read for some reason.
-
-
-
-