Stay organized with collections
Save and categorize content based on your preferences.
added in
version 1.1.0
belongs to Maven artifact android.arch.persistence:db:1.1.0-beta2
SupportSQLiteQuery
public
interface
SupportSQLiteQuery
android.arch.persistence.db.SupportSQLiteQuery
|
Known indirect subclasses
|
A query with typed bindings. It is better to use this API instead of
rawQuery(String, String[])
because it allows
binding type safe parameters.
Summary
Public methods |
abstract
void
|
bindTo(SupportSQLiteProgram statement)
Callback to bind the query parameters to the compiled statement.
|
abstract
int
|
getArgCount()
Returns the number of arguments in this query.
|
abstract
String
|
getSql()
The SQL query.
|
Public methods
bindTo
void bindTo (SupportSQLiteProgram statement)
Callback to bind the query parameters to the compiled statement.
Parameters |
statement |
SupportSQLiteProgram : The compiled statement
|
getArgCount
int getArgCount ()
Returns the number of arguments in this query. This is equal to the number of placeholders
in the query string. See: https://www.sqlite.org/c3ref/bind_blob.html for details.
Returns |
int |
The number of arguments in the query.
|
getSql
String getSql ()
The SQL query. This query can have placeholders(?) for bind arguments.
Returns |
String |
The SQL query to compile
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# SupportSQLiteQuery\n\nadded in [version 1.1.0](/topic/libraries/support-library/revisions) \nbelongs to Maven artifact android.arch.persistence:db:1.1.0-beta2 \nSummary: [Methods](#pubmethods) \n\nSupportSQLiteQuery\n==================\n\n| The `android.arch` Architecture Components packages are no longer maintained. They have been superseded by the corresponding [androidx.\\*](/jetpack/androidx/migrate) packages. See [androidx.sqlite.db.SupportSQLiteQuery](/reference/androidx/sqlite/db/SupportSQLiteQuery) instead.\n\n\n`\npublic\n\n\ninterface\nSupportSQLiteQuery\n`\n\n\n`\n\n\n`\n\n|------------------------------------------------|\n| android.arch.persistence.db.SupportSQLiteQuery |\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [SimpleSQLiteQuery](/reference/android/arch/persistence/db/SimpleSQLiteQuery) |-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [SimpleSQLiteQuery](/reference/android/arch/persistence/db/SimpleSQLiteQuery) | A basic implementation of [SupportSQLiteQuery](/reference/android/arch/persistence/db/SupportSQLiteQuery) which receives a query and its args and binds args based on the passed in Object type. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA query with typed bindings. It is better to use this API instead of\n[rawQuery(String, String[])](https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#rawQuery(java.lang.String, java.lang.String[])) because it allows\nbinding type safe parameters.\n\nSummary\n-------\n\n| ### Public methods ||\n|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[bindTo](/reference/android/arch/persistence/db/SupportSQLiteQuery#bindTo(android.arch.persistence.db.SupportSQLiteProgram))`(`[SupportSQLiteProgram](/reference/android/arch/persistence/db/SupportSQLiteProgram)` statement) ` Callback to bind the query parameters to the compiled statement. |\n| ` abstract int` | ` `[getArgCount](/reference/android/arch/persistence/db/SupportSQLiteQuery#getArgCount())`() ` Returns the number of arguments in this query. |\n| ` abstract String` | ` `[getSql](/reference/android/arch/persistence/db/SupportSQLiteQuery#getSql())`() ` The SQL query. |\n\nPublic methods\n--------------\n\n### bindTo\n\nadded in [version 1.1.0](/topic/libraries/support-library/revisions) \n\n```\nvoid bindTo (SupportSQLiteProgram statement)\n```\n\nCallback to bind the query parameters to the compiled statement.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|-------------------------------------------------------|\n| `statement` | `SupportSQLiteProgram`: The compiled statement \u003cbr /\u003e |\n\n### getArgCount\n\nadded in [version 1.1.0](/topic/libraries/support-library/revisions) \n\n```\nint getArgCount ()\n```\n\nReturns the number of arguments in this query. This is equal to the number of placeholders\nin the query string. See: https://www.sqlite.org/c3ref/bind_blob.html for details.\n\n\u003cbr /\u003e\n\n| Returns ||\n|-------|----------------------------------------------|\n| `int` | The number of arguments in the query. \u003cbr /\u003e |\n\n### getSql\n\nadded in [version 1.1.0](/topic/libraries/support-library/revisions) \n\n```\nString getSql ()\n```\n\nThe SQL query. This query can have placeholders(?) for bind arguments.\n\n\u003cbr /\u003e\n\n| Returns ||\n|----------|---------------------------------|\n| `String` | The SQL query to compile \u003cbr /\u003e |\n\n-\n\n Interfaces\n ----------\n\n - [SupportSQLiteDatabase](/reference/android/arch/persistence/db/SupportSQLiteDatabase)\n - [SupportSQLiteOpenHelper](/reference/android/arch/persistence/db/SupportSQLiteOpenHelper)\n - [SupportSQLiteOpenHelper.Factory](/reference/android/arch/persistence/db/SupportSQLiteOpenHelper.Factory)\n - [SupportSQLiteProgram](/reference/android/arch/persistence/db/SupportSQLiteProgram)\n - [SupportSQLiteQuery](/reference/android/arch/persistence/db/SupportSQLiteQuery)\n - [SupportSQLiteStatement](/reference/android/arch/persistence/db/SupportSQLiteStatement)\n-\n\n Classes\n -------\n\n - [SimpleSQLiteQuery](/reference/android/arch/persistence/db/SimpleSQLiteQuery)\n - [SupportSQLiteOpenHelper.Callback](/reference/android/arch/persistence/db/SupportSQLiteOpenHelper.Callback)\n - [SupportSQLiteOpenHelper.Configuration](/reference/android/arch/persistence/db/SupportSQLiteOpenHelper.Configuration)\n - [SupportSQLiteOpenHelper.Configuration.Builder](/reference/android/arch/persistence/db/SupportSQLiteOpenHelper.Configuration.Builder)\n - [SupportSQLiteQueryBuilder](/reference/android/arch/persistence/db/SupportSQLiteQueryBuilder)"]]