What is SQLite?
- SQLite is a opensource SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation.
- It is RDBMS, no connection establishment is required like JDBC and ODBC
- Lightweight so consumes less memory arround 250 Kb
Datatypes:-
The SQLite supports following Datatypes:
- NULL The value is a NULL value.
- INTEGER The value is a signed integer
- REAL The value is a floating point value,
- TEXT The value is a text string
- BLOB stored exactly as it was input
SQLite Vs Textfile:-
You can query items as you wish -- don't need to load all of them and select which ones you need.
updation, deletion is quite easy.
SQLite Vs Share Preferences:-
SharePreferences for small, simple and "key - value" structured data. When the Data get more and more complex, SQLite will be better for you.
DBHelper class:-
Database queries are managed by the SQLiteDatabase class.For managing all the operations related to the database , an helper class has been given and is called SQLiteOpenHelper
rawQuery() VS query():-
- rawQuery() directly accepts an SQL select statement as input.
- query() provides a structured interface for specifying the SQL query.
operation in SQLite:-
1. Read
2. Write
3. Update
4. Delete
0 Comment(s)