# SimpleSQLiteQuery

added in[version 1.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact android.arch.persistence:db:1.1.0-beta2  
Summary:[Ctors](https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery#pubctors)\|[Methods](https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery#inhmethods)  

# SimpleSQLiteQuery

| The`android.arch`Architecture Components packages are no longer maintained. They have been superseded by the corresponding[androidx.\*](https://developer.android.com/jetpack/androidx/migrate)packages. See[androidx.sqlite.db.SimpleSQLiteQuery](https://developer.android.com/reference/androidx/sqlite/db/SimpleSQLiteQuery)instead.

`
public

final

class
SimpleSQLiteQuery
`  
`

extends Object


``


implements

`[SupportSQLiteQuery](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQuery)`


`

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

<br />

*** ** * ** ***

A basic implementation of[SupportSQLiteQuery](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQuery)which receives a query and its args and binds args based on the passed in Object type.

## Summary

|                                                                                                                            ### Public constructors                                                                                                                            ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[SimpleSQLiteQuery](https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery#SimpleSQLiteQuery(java.lang.String, java.lang.Object[]))`(String query, Object[] bindArgs) ` Creates an SQL query with the sql string and the bind arguments. |
| ` `[SimpleSQLiteQuery](https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery#SimpleSQLiteQuery(java.lang.String))`(String query) ` Creates an SQL query without any bind arguments.                                                        |

|                                                                                                                                                                                             ### Public methods                                                                                                                                                                                             ||
|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static void` | ` `[bind](https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery#bind(android.arch.persistence.db.SupportSQLiteProgram, java.lang.Object[]))`(`[SupportSQLiteProgram](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteProgram)` statement, Object[] bindArgs) ` Binds the given arguments into the given sqlite statement. |
| ` void`        | ` `[bindTo](https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery#bindTo(android.arch.persistence.db.SupportSQLiteProgram))`(`[SupportSQLiteProgram](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteProgram)` statement) ` Callback to bind the query parameters to the compiled statement.                              |
| ` int`         | ` `[getArgCount](https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery#getArgCount())`() ` Returns the number of arguments in this query.                                                                                                                                                                                                                  |
| ` String`      | ` `[getSql](https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery#getSql())`() ` The SQL query.                                                                                                                                                                                                                                                            |

| ### Inherited methods |
|-----------------------|---|
| From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||
| From interface` `[android.arch.persistence.db.SupportSQLiteQuery](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQuery)` ` |--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void`   | ` `[bindTo](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQuery#bindTo(android.arch.persistence.db.SupportSQLiteProgram))`(`[SupportSQLiteProgram](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteProgram)` statement) ` Callback to bind the query parameters to the compiled statement. | | ` abstract int`    | ` `[getArgCount](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQuery#getArgCount())`() ` Returns the number of arguments in this query.                                                                                                                                                                                     | | ` abstract String` | ` `[getSql](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQuery#getSql())`() ` The SQL query.                                                                                                                                                                                                                               | ||

## Public constructors

### SimpleSQLiteQuery

added in[version 1.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
SimpleSQLiteQuery (String query, 
                Object[] bindArgs)
```

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

<br />

|                                              Parameters                                               ||
|------------|-------------------------------------------------------------------------------------------|
| `query`    | `String`: The query string, can include bind arguments (.e.g ?). <br />                   |
| `bindArgs` | `Object`: The bind argument value that will replace the placeholders in the query. <br /> |

### SimpleSQLiteQuery

added in[version 1.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
SimpleSQLiteQuery (String query)
```

Creates an SQL query without any bind arguments.

<br />

|                                     Parameters                                      ||
|---------|----------------------------------------------------------------------------|
| `query` | `String`: The SQL query to execute. Cannot include bind parameters. <br /> |

## Public methods

### bind

added in[version 1.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

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

Binds the given arguments into the given sqlite statement.

<br />

|                            Parameters                            ||
|-------------|-----------------------------------------------------|
| `statement` | `SupportSQLiteProgram`: The sqlite statement <br /> |
| `bindArgs`  | `Object`: The list of bind arguments <br />         |

### bindTo

added in[version 1.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void bindTo (SupportSQLiteProgram statement)
```

Callback to bind the query parameters to the compiled statement.

<br />

|                             Parameters                             ||
|-------------|-------------------------------------------------------|
| `statement` | `SupportSQLiteProgram`: The compiled statement <br /> |

### getArgCount

added in[version 1.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
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.

<br />

|                       Returns                       ||
|-------|----------------------------------------------|
| `int` | The number of arguments in the query. <br /> |

### getSql

added in[version 1.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
String getSql ()
```

The SQL query. This query can have placeholders(?) for bind arguments.

<br />

|                  Returns                  ||
|----------|---------------------------------|
| `String` | The SQL query to compile <br /> |

-

  ## Interfaces

  - [SupportSQLiteDatabase](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteDatabase)
  - [SupportSQLiteOpenHelper](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteOpenHelper)
  - [SupportSQLiteOpenHelper.Factory](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteOpenHelper.Factory)
  - [SupportSQLiteProgram](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteProgram)
  - [SupportSQLiteQuery](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQuery)
  - [SupportSQLiteStatement](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteStatement)
-

  ## Classes

  - [SimpleSQLiteQuery](https://developer.android.com/reference/android/arch/persistence/db/SimpleSQLiteQuery)
  - [SupportSQLiteOpenHelper.Callback](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteOpenHelper.Callback)
  - [SupportSQLiteOpenHelper.Configuration](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteOpenHelper.Configuration)
  - [SupportSQLiteOpenHelper.Configuration.Builder](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteOpenHelper.Configuration.Builder)
  - [SupportSQLiteQueryBuilder](https://developer.android.com/reference/android/arch/persistence/db/SupportSQLiteQueryBuilder)