Websql for Instant Messaging

Source: Internet
Author: User

There are several ways to websql storage:

OpenDatabase: This method uses an existing database or creates a new database to create a database object.

Transaction: This method allows us to perform transaction processing;

ExecuteSQL: This method is used to execute SQL statements;

1 var db = OpenDatabase (name,version,displayname,estimatesize,creationcallback);

Name: Names of databases;

Version: The revision number of the database;

DisplayName: Description of the database;

Estimatesize: The size of the database to hold data;

Createcallback: callback function:

2 calling transaction to execute SQL statements

Transaction (function (TX) {})

TX: The parameter received by the callback function, which is a reference to the transaction object.

3 Calling the ExecuteSQL method to represent processing transactions

Transaction.executesql (Sql,[],datahandler,errorhandler);

SQL: The SQL statement to execute;

[placeholder in]:sql statement]? "the corresponding parameter.

DataHandler: The callback function invoked when the Execute SQL statement succeeds:

ErrorHandler: The callback function that is called when the Execute SQL statement fails.

Post Code First

<!    DOCTYPE html>

Websql for Instant Messaging

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.