# AndroidSQLiteDriver

Artifact: [androidx.sqlite:sqlite-framework](https://developer.android.com/jetpack/androidx/releases/sqlite) [View Source](https://cs.android.com/search?q=file:androidx/sqlite/driver/AndroidSQLiteDriver.android.kt+class:androidx.sqlite.driver.AndroidSQLiteDriver) Added in [2.5.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.5.0)

*** ** * ** ***


```
public final class AndroidSQLiteDriver implements SQLiteDriver
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/androidx/sqlite/SQLiteDriver` implemented by `https://developer.android.com/reference/android/database/package-summary.html` and that uses the Android's SDK SQLite APIs.

This driver internally has a connection pool and a opened connection from it is safe to be used in a multi-thread and concurrent environment.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/sqlite/driver/AndroidSQLiteDriver#AndroidSQLiteDriver()()` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/sqlite/driver/AndroidSQLiteDriver#hasConnectionPool()()` Identifies whether the driver has an internal connection pool or not. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/sqlite/SQLiteConnection` | `https://developer.android.com/reference/androidx/sqlite/driver/AndroidSQLiteDriver#open(kotlin.String)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html fileName)` Opens a new database connection. |

## Public constructors

### AndroidSQLiteDriver

Added in [2.5.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.5.0)

```
public AndroidSQLiteDriver()
```

## Public methods

### hasConnectionPool

```
public boolean hasConnectionPool()
```

Identifies whether the driver has an internal connection pool or not.

A driver with an internal pool should be capable of opening connections that are safe to be used in a multi-thread and concurrent environment whereas a driver that does not have an internal pool will require the application to manage connections in a thread-safe manner. A driver might not report containing a connection pool but might still be safe to be used in a multi-thread environment, such behavior will depend on the driver implementation.

The value returned should be used as a signal to higher abstractions in order to determine if the driver and its connections should be managed by an external connection pool or not.

### open

Added in [2.5.0](https://developer.android.com/jetpack/androidx/releases/sqlite#2.5.0)

```
public @NonNull SQLiteConnection open(@NonNull String fileName)
```

Opens a new database connection.

To open an in-memory database use the special name `:memory:` as the `https://developer.android.com/reference/androidx/sqlite/SQLiteDriver#open(kotlin.String)`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html fileName` | Name of the database file. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/sqlite/SQLiteConnection` | the database connection. |