Use of SQLite (ii): Data deletion and modification

Source: Internet
Author: User
Tags sqlite sqlite database

Sqlitedatabase

The class used to manage the SQLite database. Sqlitedatabase can also perform other common database administration tasks by adding, modifying, deleting, and querying database data.

Method

Describe

(void) execsql (String sql)

Methods for executing an SQL statement

(long) Insert (String table,string nullcolumnhack,contentvalues values)

Ways to add data rows

(int) Update (string table, contentvalues values, String whereclause, string[] whereargs)

Ways to update data rows

(int) Delete (String table,string whereclause,string[] whereargs)

Ways to delete data rows

First, the data added

Three new methods of data, choose one. It is recommended to use the third method to implement the new data because it is more secure without having to stitch the string yourself.

Ii. Modification of data

Three ways to modify data, choose one. It is recommended that you use a third method to modify the data, because you do not have to stitch the strings yourself.

Third, data deletion

Three ways to delete data, choose one. It is recommended that you use the third method to remove the data, because it is more secure without having to splice the string yourself.

Iv. data Query

Cursor rawquery (String sql, string[] selectionargs)

• Parameter description: String SQL to execute the query statement, you can use a placeholder; string[] Selectionargs parameter array • Return value: Cursor result set; equivalent to ResultSet

Cursor Query (string table, string[] columns, string selection, string[] Selectionargs, String groupBy, string having, Str ing)

• Parameter description: String table: Table name; string[] colums: array of column names;

String selection: Conditional clause; string []selectionargs: An array of arguments to the conditional statement;

String groupBy: Grouping field; string having: grouping condition; String ORDER by: Sort field;

• Return value: Cursor result set; equivalent to ResultSet

Use of SQLite (ii): Data deletion and modification

Related Article

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.