Build 1.0_r1(from source)

android.database.sqlite
Class SQLiteStatement

java.lang.Object
  extended by android.database.sqlite.SQLiteClosable
      extended by android.database.sqlite.SQLiteProgram
          extended by android.database.sqlite.SQLiteStatement

public class SQLiteStatement
extends SQLiteProgram

A pre-compiled statement against a SQLiteDatabase that can be reused. The statement cannot return multiple rows, but 1x1 result sets are allowed. Don't use SQLiteStatement constructor directly, please use SQLiteDatabase.compileStatement(String)


Field Summary
 
Fields inherited from class android.database.sqlite.SQLiteProgram
mDatabase, nHandle, nStatement, TAG
 
Constructor Summary
SQLiteStatement(SQLiteDatabase db, String sql)
          Don't use SQLiteStatement constructor directly, please use SQLiteDatabase.compileStatement(String)
 
Method Summary
 void execute()
          Execute this SQL statement, if it is not a query.
 long executeInsert()
          Execute this SQL statement and return the ID of the most recently inserted row.
 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.
 
Methods inherited from class android.database.sqlite.SQLiteProgram
bindBlob, bindDouble, bindLong, bindNull, bindString, clearBindings, close, compile, finalize, getUniqueId, native_bind_blob, native_bind_double, native_bind_long, native_bind_null, native_bind_string, native_compile, native_finalize, onAllReferencesReleased, onAllReferencesReleasedFromContainer
 
Methods inherited from class android.database.sqlite.SQLiteClosable
acquireReference, releaseReference, releaseReferenceFromContainer
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLiteStatement

SQLiteStatement(SQLiteDatabase db,
                String sql)
Don't use SQLiteStatement constructor directly, please use SQLiteDatabase.compileStatement(String)

Parameters:
db -
sql -
Method Detail

execute

public void execute()
Execute this SQL statement, if it is not a query. For example, CREATE TABLE, DELTE, INSERT, etc.

Throws:
SQLException - If the SQL string is invalid for some reason

executeInsert

public long executeInsert()
Execute this SQL statement and return the ID of the most recently inserted row. The SQL statement should probably be an INSERT for this to be a useful call.

Returns:
the row ID of the last row inserted.
Throws:
SQLException - If the SQL string is invalid for some reason

simpleQueryForLong

public 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.
Throws:
SQLiteDoneException - if the query returns zero rows

simpleQueryForString

public 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.
Throws:
SQLiteDoneException - if the query returns zero rows

Build 1.0_r1(from source)

Please submit a feedback, bug or feature