Help Center

Local Navigation

Object: Database

Availability

BlackBerry® Device Software version 6.0 or later

The Database object represents a lightweight relational database on the BlackBerry device. You use SQLite queries to retrieve, add, modify, and delete data.

You access the database using window.openDatabase() method. If the database with the given name doesn't already exist when openDatabase() is called, the browser creates it.

To create a database on a device, the device must have an microSD card mounted and available. When you create a database, the browser creates a database for an application in a domain-specific subfolder on the device SDCard.

The BlackBerry Browser follows the same-origin policy for allowing access to client-side databases. Web applications are only permitted to access those resources with the same scheme, domain, and port number, as the application. An application can access a database only by using path names that are relative to the origin domain. Applications cannot access databases using absolute path names.

Database properties

Property name

Type

Description

Status

Support level

Availability

version

DOMString

Returns the current version of the database.

read only

HTML 5

6.0 or later

Database methods

Method name

Description

Support level

Availability

changeVersion()

Changes the version number of the database at the same time as doing a schema update.

HTML 5

6.0 or later

readTransaction()

Creates SQLTransaction object for a read-only transaction.

HTML 5

6.0 or later

transaction()

Creates SQLTransaction object for a read/write transaction.

HTML 5

6.0 or later

Next topic: Object: Storage
Previous topic: Storage API

Was this information helpful? Send us your comments.