the*_*sic 57
删除你的应用数据库试试这个:
this.deleteDatabase("databasename.db");
Run Code Online (Sandbox Code Playgroud)
这将删除数据库文件
ype*_*eᵀᴹ 33
创建或删除数据库的概念对于像SQLite这样的嵌入式数据库引擎没有意义.它只对客户端 - 服务器数据库系统有意义,例如MySQL或Postgres使用的系统.
要创建新数据库,只需执行sqlite_open()命令行或从命令行执行sqlite3 databasefilename.
要删除数据库,请删除该文件.
您可以tables像通常那样通过发出SQL命令来删除.如果要删除整个数据库,则必须删除该文件.您可以删除位于下方的文件
data/data/com.your.app.name/database/[databasefilename]
你可以从名为"FileBrowser"的eclipse视图中取出"Android"类别.或直接在您的模拟器或手机上.
如果要以编程方式删除数据库,可以deleteDatabase在Context类中使用:
deleteDatabase(String name)
删除与此Context的应用程序包关联的现有私有SQLiteDatabase.
SQLite database FAQ: How do I drop a SQLite database?
People used to working with other databases are used to having a "drop database" command, but in SQLite there is no similar command. The reason? In SQLite there is no "database server" -- SQLite is an embedded database, and your database is entirely contained in one file. So there is no need for a SQLite drop database command.
To "drop" a SQLite database, all you have to do is delete the SQLite database file you were accessing.
Run Code Online (Sandbox Code Playgroud)
从http://alvinalexander.com/android/sqlite-drop-database-how复制
| 归档时间: |
|
| 查看次数: |
110451 次 |
| 最近记录: |