How to use HTML5 Web SQL database

This article describe about HTML5 Web SQL database and it's functionality.
  • 2771

HTML5 - Web SQL Database

Actually Web SQL Database API is not a part of HTML5 specification, but it is a individual specification for manipulate a set of APIs in client-side database using SQL
Note: The Web SQL Database will work in mostly modern version of  Safari, Chrome and Opera.

The Core Methods:

Here we describe about core method, which are three in a number

  1. openDatabase: The openDatabase method creates the database object weather database is existing or new database creating.
  2. transaction: The transaction method give you ability to control a transaction by using commit and rollback in the situation.
  3. executeSql: The executeSQL method is used to execute  SQL query.

Opening Database:

The opening Database method is used to open the database if database does not already open. For exciting this method database must be exits.

var dab = openDatabase('empdb', '1.0', 'test DB', 2 * 1024 * 2048);

Note: Above declared method following five paramters:

  1. Name of database
  2. Version number
  3. Text description
  4. Size of database
  5. Creation callback

Note: The 5th argument, call only when database is being created. Without this feature the databases are still being created on the fly and correctly versioned.

Further Readings

You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2020 DotNetHeaven. All rights reserved.