android的sqlite主鍵設置方法

網上的那種語法貌似有問題,老是創建不成功。

db.execSQL(CREATE_TABLE + TABLE_CONTENT + " ( "
                    + "ID INTEGER, "  + "CONTENT TEXT, IS_UPLOAD INTEGER, " + "CREATE_TIME LONG ,"
                    //+ "UNIQUE (ID,  " + ACCOUNT_ID + ")"
                    + " PRIMARY KEY(\"ID\"))");改成上面這種,OK!

 

 

作者 鄧華
 

發佈留言