androidsqlite拖放表

androidsqlite拖放表,android,Android,使用sqlite在Android中删除表的正确方法是什么 我写什么 db.execSQL("drop table myTable;"); 在sqlitehelper类中还是在主活动Oncreate方法中 谢谢。创建一个字符串,如下所示: public static final String DROP_TABLE_NAME = "DROP TABLE IF EXISTS" + TABLE_NAME; 在继承了SQLiteOpenHelper类的类中,在onUpgrade方法中调用此函数,如下所

使用sqlite在Android中删除表的正确方法是什么

我写什么

db.execSQL("drop table myTable;");
在sqlitehelper类中还是在主活动Oncreate方法中


谢谢。

创建一个字符串,如下所示:

public static final String DROP_TABLE_NAME = "DROP TABLE IF EXISTS" + TABLE_NAME;
在继承了SQLiteOpenHelper类的类中,在onUpgrade方法中调用此函数,如下所示:

db.execSQL(DROP_TABLE_NAME);
希望这有帮助