我尝试在数据库中创建三个表,但它只创建 tbl_alarms、tbl_bookmarks 和 android_metadata。为什么我不能创建 tbl_locationfrommap ?
SQLiteDatabase db;
db = openOrCreateDatabase("Informations.db", SQLiteDatabase.CREATE_IF_NECESSARY, null);
db.setVersion(1);
db.setLocale(Locale.getDefault());
db.setLockingEnabled(true);
Cursor cursor=db.rawQuery("select DISTINCT tbl_name from sqlite_master where tbl_name = 'tbl_alarms'", null);
if(cursor.getCount()==0) {
final String CREATE_TABLE_ALARMS = "CREATE TABLE tbl_alarms (" +
"alarmName TEXT PRIMARY KEY," +
" distance INTEGER,
ringtone TEXT,
vibrate INTEGER,
latitude INTEGER,
longitude INTEGER,
note TEXT,
alarmTime LONG,
alarmSnoozeTime LONG);";
final String CREATE_TABLE_BOOKMARKS = "CREATE TABLE tbl_bookmarks (" +
"bookmarkName TEXT PRIMARY KEY," +
"latitude INTEGER,
longitude INTEGER);";
final String CREATE_TABLE_MAPLOCATION = "CREATE TABLE tbl_locationfrommap (" +
"latitude INTEGER PRIMARY KEY"+
" , longitude INTEGER PRIMARY KEY);";
db.execSQL(CREATE_TABLE_ALARMS);
db.execSQL(CREATE_TABLE_BOOKMARKS);
db.execSQL(CREATE_TABLE_MAPLOCATION);
}