String groupBy: Controls how the result set is grouped. String selectionArgs: Contains the replacement values for the “ ?” of the selection parameter. This string can contain “ ?” characters that can be replaced by the selectionArgs parameter. String selection: Specifies the WHERE clause of the selection statement. String columns: Lists the columns that should be included in the result set of the query. String table: Indicates the table name of the query. Each variant of the query() method takes a parameter list that includes the following: These methods are the overloaded variations of SQLiteDatabase.query(). The simplest way to issue a query to a database in Android is to use one of the query convenience methods located in SQLiteDatabase. There is also an SQLiteQueryBuilder class that can further aid in developing complex queries such as joins. In addition to a series of query convenience methods, SQLiteDatabase includes a set of methods that support more free-form “raw” queries that can be generated via standard Java string manipulation methods. As with the insert and update database operations, SQLiteDatabase contains multiple methods to support retrieving data. The last piece of database CRUD functionality is retrieving data from the database. Previous sections of this chapter discussed inserting, updating, and deleting data from a database.
0 Comments
Leave a Reply. |