Posts

Showing posts with the label 9. HTML5 Web SQL Database

009. HTML5 Web SQL Database

The Web SQL Database API isn't actually part of the HTML5 specification but it is a separate specification which introduces a set of APIs to manipulate client-side databases using SQL. Web SQL Database will work in latest version of Safari, Chrome and Opera. The Core Methods: There are following three core methods defined in the spec that I.m going to cover in this tutorial: openDatabase:  This method creates the database object either using existing database or creating new one. transaction:  This method give us the ability to control a transaction and performing either commit or rollback based on the situation. executeSql:  This method is used to execute actual SQL query. Opening Database: The  openDatabase  method takes care of opening a database if it already exists, this method will create it if it already does not exist. To create and open a database, use the following code: var db = openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024); Above method...