[ Web Proxy ]
URL:
Viewing: https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery [Back]  [Original]

SimpleSQLiteQuery  |  API reference  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]
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

SimpleSQLiteQuery

public final class SimpleSQLiteQuery
extends Object implements SupportSQLiteQuery

java.lang.Object
   ↳ android.arch.persistence.db.SimpleSQLiteQuery


A basic implementation of SupportSQLiteQuery which receives a query and its args and binds args based on the passed in Object type.

Summary

Public constructors

SimpleSQLiteQuery(String query, Object[] bindArgs)

Creates an SQL query with the sql string and the bind arguments.

SimpleSQLiteQuery(String query)

Creates an SQL query without any bind arguments.

Public methods

static void bind(SupportSQLiteProgram statement, Object[] bindArgs)

Binds the given arguments into the given sqlite statement.

void bindTo(SupportSQLiteProgram statement)

Callback to bind the query parameters to the compiled statement.

int getArgCount()

Returns the number of arguments in this query.

String getSql()

The SQL query.

Inherited methods

Public constructors

SimpleSQLiteQuery

added in version 1.1.0
SimpleSQLiteQuery (String query, 
                Object[] bindArgs)

Creates an SQL query with the sql string and the bind arguments.

Parameters
query String: The query string, can include bind arguments (.e.g ?).

bindArgs Object: The bind argument value that will replace the placeholders in the query.

SimpleSQLiteQuery

added in version 1.1.0
SimpleSQLiteQuery (String query)

Creates an SQL query without any bind arguments.

Parameters
query String: The SQL query to execute. Cannot include bind parameters.

Public methods

bind

added in version 1.1.0
void bind (SupportSQLiteProgram statement, 
                Object[] bindArgs)

Binds the given arguments into the given sqlite statement.

Parameters
statement SupportSQLiteProgram: The sqlite statement

bindArgs Object: The list of bind arguments

bindTo

added in version 1.1.0
void bindTo (SupportSQLiteProgram statement)

Callback to bind the query parameters to the compiled statement.

Parameters
statement SupportSQLiteProgram: The compiled statement

getArgCount

added in version 1.1.0
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

added in version 1.1.0
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.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page