Would you like to tell us how we are doing?

You bet No thanks

Sorry about the red box, but we really need you to update your browser. Read this excellent article if you're wondering why we are no longer supporting this browser version. Go to Browse Happy for browser suggestions and how to update.

Storing data in SQLite databases

SQLite is a relational database management system. With a code footprint of roughly 300 KB, SQLite is well suited to small devices such as smartphones. In addition, SQLite makes efficient use of memory, disk space, and disk bandwidth; and SQLite databases require no maintenance from a database administrator.

To create and use SQLite databases in your Java app, you must use the Database API, which is the net.rim.device.api.database package.

The Database API implements SQLite databases in a way that might be slightly different from what you're used to. To improve efficiency, SQLite runs as a service on the BlackBerry smartphone. Database operations use a runtime bridge to transfer data between Java and native code. For more information, see Performance of SQLite databases.

BlackBerry Device Software 7 uses SQLite 3.7.2. For more information about SQLite, see www.sqlite.org.

Viewing SQLite databases

SQLite database viewers are available from third-party vendors. These viewers can be useful aids to your database development process. Database viewers are especially useful for viewing changes to a database. When you run an SQL statement, you can see the result in the database viewer immediately.

An SQLite database viewer runs on your computer, not on the smartphone. To use the viewer, configure the BlackBerry Smartphone Simulator to emulate a microSD card. When you run your application, your database viewer reads the database from a folder on your computer.

SQLite database viewers cannot work on encrypted databases. You can encrypt the database after you complete your SQLite application.

Simulate a media card

To view SQLite databases in a database viewer, you might have to configure the BlackBerry Smartphone Simulator to emulate a media card. By default, database files are stored on a media card.

Create a folder on your computer to store emulation files for the media card.

In the BlackBerry Smartphone Simulator, on the Simulate menu, click Change SD Card.

Click Add Directory.

Navigate to and click the folder you created.

Click OK.

Click Close.