dimanche 4 janvier 2015

Add the Autoincrement _id column

Hey i made a whole app without adding an autoincrement column but now i need this column to specify the max id so i created my database in my mainactivity like this.How can i modify this to add the autoincrement _id column ?



db = getActivity().openOrCreateDatabase("testDB2", Context.MODE_PRIVATE, null);
db.execSQL("CREATE TABLE IF NOT EXISTS test2(mac VARCHAR,mdp VARCHAR,obj VARCHAR);");


I don't want to create a seonc java classs only for the database because i did all the code like this.


Aucun commentaire:

Enregistrer un commentaire