Database (1) 近;“现有用户信息”:语法错误

Database (1) 近;“现有用户信息”:语法错误,database,Database,我正在执行此代码以将数据存储在Android手机内置的SQLite数据库中。当我执行代码时,我收到一条错误消息,它是“(1)接近“existsUserInformation”:语法错误 请帮我解决这个问题。字符串连接中缺少空格: public class DataBaseClass extends SQLiteOpenHelper { public static final String DB_NAME = "USER DATA"; public static final in

我正在执行此代码以将数据存储在Android手机内置的SQLite数据库中。当我执行代码时,我收到一条错误消息,它是“(1)接近“existsUserInformation”:语法错误


请帮我解决这个问题。

字符串连接中缺少空格:

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);

        }
结果在字符串中

"create table if not exists" + TABLE_NAME_USERSINFO
只需在存在后添加一个空格:

"create table if not existsUserInformation".

语句末尾还有一个额外的逗号。

最后一列末尾有一个逗号(column_NAME_DOB+“text not null,”)…请更正,我修复了此错误,但仍然会得到相同的错误…谢谢。。它对我有用。。。现在它给出了另一个错误…(1)只允许在整数主键上自动递增“。。。
"create table if not exists " + TABLE_NAME_USERINFO.