public class DataBaseClass extends SQLiteOpenHelper { public static final String DB_NAME = "USER DATA"; public static final int DB_VERSION = 1; public static final String TABLE_NAME_USERSINFO = "UserInformation"; public static final String COLUMN_NAME_FIRSTNAME = "FirstNamestring"; public static final String COLUMN_NAME_LASTNAME = "LastNamestring"; public static final String COLUMN_NAME_ADD1 = "Add1string"; public static final String COLUMN_NAME_ADD2 = "Add2string"; public static final String COLUMN_NAME_SSNFRST ="SSnfirststring"; public static final String COLUMN_NAME_SSNLST = "SSnlaststring"; public static final String COLUMN_NAME_MOBNO = "ContactNostring"; public static final String COLUMN_NAME_EMAILID = "emailidstring"; public static final String COLUMN_NAME_DOB = "Dateofbirthstring"; public DataBaseClass(Context context) { super(context, DB_NAME, null, DB_VERSION); // TODO Auto-generated constructor stub } @Override public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub String sqlQueryToCreateUserInformation = "create table if not exists" + TABLE_NAME_USERSINFO + "(" + BaseColumns._ID + "integer primary key autoincrement," + COLUMN_NAME_FIRSTNAME + " text not null," + COLUMN_NAME_LASTNAME + " text not null," + COLUMN_NAME_ADD1 + " text not null," + COLUMN_NAME_ADD2 + " text not null," + COLUMN_NAME_SSNFRST + " text not null," + COLUMN_NAME_SSNLST + " text not null," + COLUMN_NAME_MOBNO + " text not null," + COLUMN_NAME_EMAILID + " text not null," + COLUMN_NAME_DOB + " text not null," + ");"; db.execSQL(sqlQueryToCreateUserInformation); } public void insertForm(String FirstNmstring, String LastNmstring, String Add1string ,String Add2string,String SSnfirststring, String SSnlaststring, String ContactNostring, String emailidstring, String Dateofbirthstring) { String sqlQueryToCreateUserInformation; ContentValues cv=new ContentValues(); cv.put(COLUMN_NAME_FIRSTNAME,FirstNmstring); cv.put(COLUMN_NAME_LASTNAME, LastNmstring); cv.put(COLUMN_NAME_ADD1, Add1string); cv.put(COLUMN_NAME_ADD2, Add2string); cv.put(COLUMN_NAME_SSNFRST, SSnfirststring); cv.put(COLUMN_NAME_SSNLST, SSnlaststring); cv.put(COLUMN_NAME_MOBNO, ContactNostring); cv.put(COLUMN_NAME_EMAILID, emailidstring); cv.put(COLUMN_NAME_DOB, Dateofbirthstring); getWritableDatabase().insert("USER DATA", null, cv); }
I am executing this code to store my data in SQLite database built in Android phones. When I am executing my code, I am getting an error message that is "(1) near "existsUserInformation": syntax error"
Kindly help me out with this.