我想使用username在SQLite中创建表。但是当用户名有点(。)或以数字开头时,程序因SQLite错误而崩溃(例如username = araz.13
我该如何解决这个问题? 这是我的代码
void CreateProfileDB(String Username) {
String TBLname = Username + "Tbl";
String CreateTBL = "CREATE TABLE IF NOT EXISTS " + TBLname + " ("
+ ID + " INTEGER PRIMARY KEY, "
+ Book + " TEXT NOT NULL, " + Lesson + " TEXT NOT NULL, "
+ Question + " TEXT NOT NULL, " + Answer + " TEXT NOT NULL, "
+ Accent + " TEXT, " + Option1 + " TEXT, "
+ Option2 + " TEXT, " + Option3 + " TEXT, "
+ Option4 + " TEXT, " + Option5 + " TEXT, "
+ TrueOption + " TEXT, " + EnglishSen1 + " TEXT, "
+ EnglishSen2 + " TEXT, " + EnglishSen3 + " TEXT, "
+ PersianSen1 + " TEXT, " + PersianSen2 + " TEXT, "
+ PersianSen3 + " TEXT, " + FirstShow + " TEXT, "
+ LastShow + " TEXT, " + NoOfShow + " INTEGER, "
+ StepNo + " INTEGER, " + TrueNo + " INTEGER, "
+ WrongNo + " INTEGER, " + NextShow + " TEXT);";
SQLiteDatabase PDB = this.getWritableDatabase();
PDB.execSQL(CreateTBL);