August 2,2016
SQLiteDatabase class
It contains methods to be performed on sqlite database such as create, update, delete, select etc.
Methods of SQLiteDatabase class
There are many methods in SQLiteDatabase class. Some of them are as follows:
| Method | Description |
|---|---|
| void execSQL(String sql) | executes the sql query not select query. |
| long insert(String table, String nullColumnHack, ContentValues values) | inserts a record on the database. The table specifies the table name, nullColumnHack doesn’t allow completely null values. If second argument is null, android will store null values if values are empty. The third argument specifies the values to be stored. |
| int update(String table, ContentValues values, String whereClause, String[] whereArgs) | updates a row. |
| Cursor query(String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy) | returns a cursor over the resultset. |