SQLiteConnection


  • Common/All
  • Android/JVM
  • Native/C/iOS

SQLite connection definition.

A connection to a database is a resource that must be released once it is no longer needed via its close function.

See also Database Connection

Summary

Public functions

Unit

Closes the database connection.

Cmn
SQLiteStatement

Prepares a new SQL statement.

Cmn

Extension functions

Unit

Executes a single SQL statement that returns no values.

Cmn

Public functions

close

fun close(): Unit

Closes the database connection.

Once a connection is closed it should no longer be used. Calling this function on an already closed database connection is a no-op.

prepare

fun prepare(sql: String): SQLiteStatement

Prepares a new SQL statement.

See also Compiling a SQL statement

Parameters
sql: String

the SQL statement to prepare

Returns
SQLiteStatement

the prepared statement.

Extension functions

execSQL

fun SQLiteConnection.execSQL(sql: String): Unit

Executes a single SQL statement that returns no values.

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Jan 24, 2025

The Android Gradle plugin provides access points you can use to extend it and build your own plugin.

Updated Jan 24, 2025

In this codelab, you’ll build an Android App which lists a series of restaurants. It aims to help design, configure, and verify Android App Links.

Updated Sep 21, 2023