Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

SQLiteDatabase.OpenParams

public static final class SQLiteDatabase.OpenParams
extends Object

java.lang.Object
   ↳ android.database.sqlite.SQLiteDatabase.OpenParams


Wrapper for configuration parameters that are used for opening SQLiteDatabase

Summary

Nested classes

class SQLiteDatabase.OpenParams.Builder

Builder for SQLiteDatabase.OpenParams

Public methods

SQLiteDatabase.CursorFactory getCursorFactory()

Returns an optional factory class that is called to instantiate a cursor when query is called

DatabaseErrorHandler getErrorHandler()

Returns handler for database corruption errors

long getIdleConnectionTimeout()

Returns maximum number of milliseconds that SQLite connection is allowed to be idle before it is closed and removed from the pool.

String getJournalMode()

Returns journal mode.

int getLookasideSlotCount()

Returns total number of lookaside memory slots per database connection or -1 if not set.

int getLookasideSlotSize()

Returns size in bytes of each lookaside slot or -1 if not set.

int getOpenFlags()

Returns flags to control database access mode.

String getSynchronousMode()

Returns synchronous mode.

Inherited methods

Public methods

getCursorFactory

added in API level 27
public SQLiteDatabase.CursorFactory getCursorFactory ()

Returns an optional factory class that is called to instantiate a cursor when query is called

Returns
SQLiteDatabase.CursorFactory

This value may be null.

getErrorHandler

added in API level 27
public DatabaseErrorHandler getErrorHandler ()

Returns handler for database corruption errors

Returns
DatabaseErrorHandler

This value may be null.

getIdleConnectionTimeout

added in API level 27
public long getIdleConnectionTimeout ()

Returns maximum number of milliseconds that SQLite connection is allowed to be idle before it is closed and removed from the pool.

If the value isn't set, the timeout defaults to the system wide timeout

Returns
long timeout in milliseconds or -1 if the value wasn't set.

getJournalMode

added in API level 28
public String getJournalMode ()

Returns journal mode. This journal mode will only be used if SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING flag is not set, otherwise a platform will use "WAL" journal mode.

Returns
String

This value may be null.

getLookasideSlotCount

added in API level 27
public int getLookasideSlotCount ()

Returns total number of lookaside memory slots per database connection or -1 if not set.

Returns
int

Value is -1 or greater.

getLookasideSlotSize

added in API level 27
public int getLookasideSlotSize ()

Returns size in bytes of each lookaside slot or -1 if not set.

Returns
int

Value is -1 or greater.

getOpenFlags

added in API level 27
public int getOpenFlags ()

Returns flags to control database access mode. Default value is 0.

Returns
int

Value is either 0 or combination of OPEN_READWRITE, OPEN_READONLY, CREATE_IF_NECESSARY, NO_LOCALIZED_COLLATORS or ENABLE_WRITE_AHEAD_LOGGING.

getSynchronousMode

added in API level 28
public String getSynchronousMode ()

Returns synchronous mode. If not set, a system wide default will be used.

Returns
String

This value may be null.