X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=src%2Fro%2Fieval%2Funical%2FMySQLiteHelper.java;h=dbadca58e89af64f5497ccff38c71824c9c9de64;hb=8a08d036704efadbfcd4f7c4be1721f915d929c9;hp=889ebdaeb7b4faf62518c9219a0913d466818063;hpb=bdd8f09cf842a79c5b667632d2866f38e366a86c;p=unical.git diff --git a/src/ro/ieval/unical/MySQLiteHelper.java b/src/ro/ieval/unical/MySQLiteHelper.java index 889ebda..dbadca5 100644 --- a/src/ro/ieval/unical/MySQLiteHelper.java +++ b/src/ro/ieval/unical/MySQLiteHelper.java @@ -1,10 +1,7 @@ package ro.ieval.unical; -import java.sql.SQLClientInfoException; - import android.content.Context; import android.database.sqlite.SQLiteDatabase; -import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; @@ -12,10 +9,10 @@ public class MySQLiteHelper extends SQLiteOpenHelper { public static final String Name="Events"; public static final String ID = "_id"; - public static final String name = "Name"; + public static final String title = "Title"; public static final String description = "Description"; public static final String date = "Date"; - public static final String time = "Time"; + public static final String duration = "Duration"; public static final String repeat = "repeat"; public static final String repeatIn = "repeatInterval"; public static final String location = "Location"; @@ -23,11 +20,12 @@ public class MySQLiteHelper extends SQLiteOpenHelper { private static final int dbversion=1; private static final String Database_create = "create table " + Name + "(" + - ID + " integer primary key autoincrement, " + - name + " text not null, " + + //ID + " integer primary key autoincrement, " + + ID + " text primary key, " + + title + " text not null, " + description + " text, " + date + " integer, " + - time + " integer, " + + duration + " integer, " + repeat + " integer, "+ repeatIn + " integer, " + location + " text);" @@ -49,10 +47,10 @@ public class MySQLiteHelper extends SQLiteOpenHelper { public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { // TODO Auto-generated method stub Log.w(MySQLiteHelper.class.getName(), - "Upgrading database from version " + oldVersion + " to " - + newVersion + ", which will destroy all old data"); - db.execSQL("DROP TABLE IF EXISTS " + Name); - onCreate(db); + "Upgrading database from version " + oldVersion + " to " + + newVersion + ", which will destroy all old data"); + db.execSQL("DROP TABLE IF EXISTS " + Name); + onCreate(db); } } \ No newline at end of file