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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      void executeRaw() Execute this SQL statement, if it is not a SELECT / INSERT / DELETE / UPDATE, for example CREATE / DROP table, view, trigger, index etc.
      void execute() Execute this SQL statement, if it is not a SELECT / INSERT / DELETE / UPDATE, for example CREATE / DROP table, view, trigger, index etc.
      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.
      long executeInsert() Execute this SQL statement and return the ID of the row inserted due to this call.
      long simpleQueryForLong() Execute a statement that returns a 1 by 1 table with a numeric value.
      String simpleQueryForString() Execute a statement that returns a 1 by 1 table with a text value.
      ParcelFileDescriptor simpleQueryForBlobFileDescriptor() Executes a statement that returns a 1 by 1 table with a blob value.
      String toString()
      • 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
    • Constructor Detail

    • 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 null if the value is null or could not be read for some reason.