docs/doc/reference/com/google/android/exoplayer2/database/DatabaseProvider.html
Package com.google.android.exoplayer2.database
DefaultDatabaseProvider, ExoDatabaseProvider, StandaloneDatabaseProvider[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceDatabaseProvider
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
Provides SQLiteDatabase instances to media library components, which may read and write tables prefixed with TABLE_PREFIX.
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static String | TABLE_PREFIX |
Deprecated.
Prefix for tables that can be read and written by media library components. |
All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| SQLiteDatabase | getReadableDatabase() |
Deprecated.
Creates and/or opens a database.
|
| SQLiteDatabase | getWritableDatabase() |
Deprecated.
Creates and/or opens a database that will be used for reading and writing. |
-
static final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")TABLE_PREFIX
Deprecated.
Prefix for tables that can be read and written by media library components. See Also:Constant Field Values
-
[SQLiteDatabase](https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html "class or interface in android.database.sqlite")getWritableDatabase()
Deprecated.
Creates and/or opens a database that will be used for reading and writing.
Once opened successfully, the database is cached, so you can call this method every time you need to write to the database. Errors such as bad permissions or a full disk may cause this method to fail, but future attempts may succeed if the problem is fixed.
Returns:A read/write database object.Throws:SQLiteException - If the database cannot be opened for writing.
-
[SQLiteDatabase](https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html "class or interface in android.database.sqlite")getReadableDatabase()
Deprecated.
Creates and/or opens a database. This will be the same object returned by getWritableDatabase() unless some problem, such as a full disk, requires the database to be opened read-only. In that case, a read-only database object will be returned. If the problem is fixed, a future call to getWritableDatabase() may succeed, in which case the read-only database object will be closed and the read/write object will be returned in the future.
Once opened successfully, the database is cached, so you can call this method every time you need to read from the database.
Returns:A database object valid until getWritableDatabase() is called.Throws:SQLiteException - If the database cannot be opened.