1 / 13

kjxj

cnbcjdbgyudgyud

Mr37
Download Presentation

kjxj

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SQLITE SQLITE (SUPPORTED BY BLACKBERRY OS 5.0.) Name : Abdullah ID : S202007010

  2. OVERVIEW : SQLite Library SQLite Database Database Security Options A STATEMENT LIFECYCLE Remove Databases References

  3. SQLITE LIBRARY It is a relational database library. Has a small footprint Hence, it is good for small devices BlackBerry devices that run BlackBerry Device Software version 5.0 or later supports SQLite library. SQLite library has been introduced in BlackBerry Java Development Environment Version 5 and later.

  4. SQLITE LIBRARY (CONT.) The package that provides classes and interfaces to work with SQLite is “net.rim.device.api.database”. DB locations can be : SD Card: /SDCard/ Device memory: /store/home/user System memory: /system/ Default location: /SDCard/databases/<application_name>

  5. SQLITE DATABASE SQLite database is stored in a single file on a SD Card. The default location for a SQLite database is /SDCard/databases/<application_name> • You can store the database file in the device memory by specifying the file system path • It can be encrypted or plain text.

  6. OPEN OR CREATE A DATABASE public void createPlainDatabaseFile() throws Exception { // The database is created in SD card String dbLocation = "/SDCard/databases/myApplication/"; //if you want to create the database in flash memory use the following URI // dbLocation = "/store/home/user/"; //Create a URI path file for the database URI uri = URI.create(dbLocation + “myDB.db”); // Invoke the create() or openOrCreate() method Database db = DatabaseFactory.openOrCreate(uri, new DatabaseSecurityOptions(false)) }

  7. ENCRYPTED DATABASES A database can be encrypted by specifying the security options in Creat() or openOrCreate() method: DatabaseFactory.create(URI fileURI, DatabaseSecurityOptions securityOptions); DatabaseFactory.openOrCreate(URI fileURI, DatabaseSecurityOptions securityOptions);

  8. DATABASESECURITY OPTIONS DatabaseSecurityOptions defines the security options for a database. There are three choices available : Not encrypted, accessible from any application Encrypted, accessible from any application Encrypted and protected, accessible only from applications that are signed with code signed key

  9. DATABASE CLASS Database class allows to create, delete and execute SQL statements In order to create a SQL statement, invoke createStatement() method of Database class. Statement createStatement(String sqlStatement) • Creates a Statement in this database. The argument can contain multiple SQL Statements delimited by ‘;’

  10. A STATEMENT LIFECYCLE It represents a SQL statement. The lifecycle of a statement is : Create a statement Prepare statement Bind Query Execution or Update Execution

  11. DELETE A DATABASE Invoke DatabaseFactory.delete() to remove an exisiting database from the device. The method’s signature : public static void delete( URI fileURI) • Example : URI uri = URI.create("/SDCard/databases/myApplication/" + “myDB.db”); //Remove the database from the device DatabaseFactory.delete(uri);

  12. REFERENCES :- BlackBerry Java Application SQLite Version. 5.0 (Development Guide) Available online at http://www.blackberry.com/developers

  13. THANK YOU!

More Related