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