How to use HTML5 Web SQL database
This article describe about HTML5 Web SQL database and it's functionality.
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
- openDatabase: The openDatabase method creates the database object weather database is existing or new database creating.
- transaction: The transaction method give you ability to control a transaction by using commit and rollback in the situation.
- executeSql: The executeSQL method is used to execute SQL query.
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:
- Name of database
- Version number
- Text description
- Size of database
- 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.
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