Android SQLiteDatabase class

Android SQLiteDatabase class contains methods to be performed on sqlite database such as create, update, delete, select etc.

There are many methods in SQLiteDatabase class. Some of them are as below:

MethodDescription
void execSQL(String sql)It executes the sql query not select query.
long insert(String table, String nullColumnHack, ContentValues values)It 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)It updates a row.
Cursor query(String table, String[] columns, String selection, String[] selectionArgs, String groupBy, String having, String orderBy)It returns a cursor over the result set.
Methods of SQLiteDatabase class