public abstract class

SQLiteProgram

extends SQLiteClosable
java.lang.Object
   ↳ android.database.sqlite.SQLiteClosable
     ↳ android.database.sqlite.SQLiteProgram
Known Direct Subclasses

Class Overview

A base class for compiled SQLite programs.

SQLiteProgram is NOT internally synchronized so code using a SQLiteProgram from multiple threads should perform its own synchronization when using the SQLiteProgram.

Summary

Fields
protected SQLiteDatabase mDatabase This field is deprecated. do not use this
protected int nHandle This field is deprecated. do not use this
protected int nStatement This field is deprecated. do not use this
Public Methods
void bindAllArgsAsStrings(String[] bindArgs)
Given an array of String bindArgs, this method binds all of them in one single call.
void bindBlob(int index, byte[] value)
Bind a byte array value to this statement.
void bindDouble(int index, double value)
Bind a double value to this statement.
void bindLong(int index, long value)
Bind a long value to this statement.
void bindNull(int index)
Bind a NULL value to this statement.
void bindString(int index, String value)
Bind a String value to this statement.
void clearBindings()
Clears all existing bindings.
void close()
Release this program's resources, making it invalid.
final int getUniqueId()
This method is deprecated. do not use this method. it is not guaranteed to be the same across executions of the SQL statement contained in this object.
Protected Methods
void compile(String sql, boolean forceCompilation)
This method is deprecated. This method is deprecated and must not be used.
final void native_bind_blob(int index, byte[] value)
final void native_bind_double(int index, double value)
final void native_bind_long(int index, long value)
final void native_bind_null(int index)
final void native_bind_string(int index, String value)
final void native_compile(String sql)
This method is deprecated. This method is deprecated and must not be used. Compiles SQL into a SQLite program.

The database lock must be held when calling this method.

final void native_finalize()
This method is deprecated. This method is deprecated and must not be used.
void onAllReferencesReleased()
void onAllReferencesReleasedFromContainer()
[Expand]
Inherited Methods
From class android.database.sqlite.SQLiteClosable
From class java.lang.Object

Fields

protected SQLiteDatabase mDatabase

Since: API Level 1

This field is deprecated.
do not use this

The database this program is compiled against.

protected int nHandle

Since: API Level 1

This field is deprecated.
do not use this

Native linkage, do not modify. This comes from the database and should not be modified in here or in the native code.

protected int nStatement

Since: API Level 1

This field is deprecated.
do not use this

SQLiteCompiledSql statement id is populated with the corresponding object from the above member. This member is used by the native_bind_* methods

Public Methods

public void bindAllArgsAsStrings (String[] bindArgs)

Since: API Level 11

Given an array of String bindArgs, this method binds all of them in one single call.

Parameters
bindArgs the String array of bind args.

public void bindBlob (int index, byte[] value)

Since: API Level 1

Bind a byte array value to this statement. The value remains bound until clearBindings() is called.

Parameters
index The 1-based index to the parameter to bind
value The value to bind

public void bindDouble (int index, double value)

Since: API Level 1

Bind a double value to this statement. The value remains bound until clearBindings() is called.

Parameters
index The 1-based index to the parameter to bind
value The value to bind

public void bindLong (int index, long value)

Since: API Level 1

Bind a long value to this statement. The value remains bound until clearBindings() is called. addToBindArgs

Parameters
index The 1-based index to the parameter to bind
value The value to bind

public void bindNull (int index)

Since: API Level 1

Bind a NULL value to this statement. The value remains bound until clearBindings() is called.

Parameters
index The 1-based index to the parameter to bind null to

public void bindString (int index, String value)

Since: API Level 1

Bind a String value to this statement. The value remains bound until clearBindings() is called.

Parameters
index The 1-based index to the parameter to bind
value The value to bind

public void clearBindings ()

Since: API Level 1

Clears all existing bindings. Unset bindings are treated as NULL.

public void close ()

Since: API Level 1

Release this program's resources, making it invalid.

public final int getUniqueId ()

Since: API Level 1

This method is deprecated.
do not use this method. it is not guaranteed to be the same across executions of the SQL statement contained in this object.

Returns a unique identifier for this program.

Returns
  • a unique identifier for this program

Protected Methods

protected void compile (String sql, boolean forceCompilation)

Since: API Level 1

This method is deprecated.
This method is deprecated and must not be used.

Parameters
sql the SQL string to compile
forceCompilation forces the SQL to be recompiled in the event that there is an existing compiled SQL program already around

protected final void native_bind_blob (int index, byte[] value)

Since: API Level 1

protected final void native_bind_double (int index, double value)

Since: API Level 1

protected final void native_bind_long (int index, long value)

Since: API Level 1

protected final void native_bind_null (int index)

Since: API Level 1

protected final void native_bind_string (int index, String value)

Since: API Level 1

protected final void native_compile (String sql)

Since: API Level 1

This method is deprecated.
This method is deprecated and must not be used. Compiles SQL into a SQLite program.

The database lock must be held when calling this method.

Parameters
sql The SQL to compile.

protected final void native_finalize ()

Since: API Level 1

This method is deprecated.
This method is deprecated and must not be used.

protected void onAllReferencesReleased ()

Since: API Level 1

protected void onAllReferencesReleasedFromContainer ()

Since: API Level 1