[英]Android: Sqlite DB Upgrade openOrCreateDatabase
Have used openOrCreateDatabase to create a SQLiteDatabase associated with my application package. 已经使用openOrCreateDatabase创建与我的应用程序包关联的SQLiteDatabase。 Wat does setVersion api do?
Wat setVersion API可以做什么? Now my DB is getting upgraded on newer version of my app.Is there any upgrade callback?
现在我的数据库正在使用新版本的应用程序进行升级。是否有任何升级回调? OR we need to use SQLiteOpenHelper to get upgrade callback?
还是我们需要使用SQLiteOpenHelper来获取升级回调?
openOrCreateDatabase()
just opens the database file, creating a new one if one doesn't already exist. openOrCreateDatabase()
只是打开数据库文件,如果还不存在则创建一个新文件。
There's no versioning involved, and no schema creation / upgrade callbacks. 没有版本控制,也没有架构创建/升级回调。
SQLiteOpenHelper
is an easy way to provide such functionality. SQLiteOpenHelper
是提供此类功能的简便方法。
To learn how SQLiteOpenHelper
does the versioning and invokes callbacks, see the source . 要了解如何
SQLiteOpenHelper
做了版本控制和调用回调,看到源 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.