請幫助我,我不明白它.i將創建數據庫,但它error.please我會在第二天晚上結束示例項目。請幫我SQLiteDatabase錯誤「sqlite:(1)near」(「:語法錯誤
代碼
public class FriendsDBHelper extends SQLiteOpenHelper {
public static int TABLE_VERSION = 1;
public static String TABLE_NAME ="table_f";
public static String TABLE_KEY_ID = "id";
public static String TABLE_KEY_FNAME = "fname";
public static String TABLE_KEY_LNAME = "lname";
public static String TABLE_KEY_NNAME = "nickname";
public static String TABLE_CREATE_SQL = "CREATE TABLE "+TABLE_NAME+" ("+
""+TABLE_KEY_ID+" INTEGER PRIMARY KEY AUTOINCREMENT, "+
""+TABLE_KEY_FNAME+"TEXT(20), "+
""+TABLE_KEY_LNAME+"TEXT(20), "+
""+TABLE_KEY_NNAME+"TEXT(20), "+
") ";
//Constructor
public FriendsDBHelper(Context context) {
super(context, TABLE_NAME, null, TABLE_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(TABLE_CREATE_SQL);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE "+TABLE_NAME);
onCreate(db);
Log.i("Friends DB Helper","Table upgrade form "+ oldVersion +" to "+newVersion);
}
}