Skip to content

Most visited

Recently visited

navigation

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.

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.

Inherited methods

From class java.lang.Object

Public methods

getCursorFactory

added in API level 27
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.

See also:

getErrorHandler

added in API level 27
DatabaseErrorHandler getErrorHandler ()

Returns handler for database corruption errors

Returns
DatabaseErrorHandler

This value may be null.

See also:

getIdleConnectionTimeout

added in API level 27
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.

getLookasideSlotCount

added in API level 27
int getLookasideSlotCount ()

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

Returns
int

Value is -1 or greater.

See also:

getLookasideSlotSize

added in API level 27
int getLookasideSlotSize ()

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

Returns
int

Value is -1 or greater.

See also:

getOpenFlags

added in API level 27
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.

See also:

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)