SQLite Tutorial, Create Tables,Insert, select & delete data in tables. Video 3

Опубликовано: 28 Октябрь 2024
на канале: Application Development Tutorial Point
63
0

SQLite Tutorial, SQLite Tutorials for Beginners, Learn SQLite.
SQLite Coding: https://androidsqlitedevelopment.blog...
http://softdevelopmentstepbystep.blog...
Blog: http://www.stepbystepdevelopment.com

getWritableDatabase () : Create and/or open a database that will be used for reading
and writing. The first time this is called, the database will be opened and following
events will be called.
1. onCreate(SQLiteDatabase),
2. onUpgrade(SQLiteDatabase, int, int)
3. onOpen(SQLiteDatabase)

SQLiteOpenHelper (Context context, String name, SQLiteDatabase.CursorFactory
factory, int version).This Create a helper object to create, open, and/or manage a
database. The database is not actually created or opened until one or
getReadableDatabase() is called.

We need to define Database name as name and version no as version no. If database
already exists then new will not be created. To create new database when we have done
some changes with fields we should change the version no.