E/SQLiteLog:(1)“-”附近:在 android 应用程序中插入数据时出现语法错误

E/SQLiteLog: (1) near "-": syntax error when insert data in android app

当我尝试写入数据库时​​,我的应用程序出现此错误 E/SQLiteLog: (1) "-" 附近:语法错误 请你能帮帮我... 这是我的 SQLite 数据库代码。我在此处

附上数据库 class 的完整代码
import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

/**
 * Created by TOSHIBA on 01/05/2016.
 */

// CREATION DATABASE

public class DatabaseHelper extends SQLiteOpenHelper {
    private SQLiteDatabase db;

    private static final String DATABASE_NAME = "QuickTowing.db";

    private static final String QUERY =
           "CREATE TABLE "+ TablesDB.NewClientInfo.TABLE_NAME+"("+ TablesDB.NewClientInfo.COL_1+" INTEGER PRIMARY KEY AUTOINCREMENT,"
                   + TablesDB.NewClientInfo.COL_2+" TEXT,"+ TablesDB.NewClientInfo.COL_3+" TEXT,"+ TablesDB.NewClientInfo.COL_4+" TEXT,"
                  + TablesDB.NewClientInfo.COL_5+" INTEGER,"+ TablesDB.NewClientInfo.COL_6+" TEXT,"+ TablesDB.NewClientInfo.COL_7+" TEXT,"
                   + TablesDB.NewClientInfo.COL_8+" TEXT);";

    //CREATE DATABASE
    public DatabaseHelper(Context context) {

        super(context, DATABASE_NAME, null, 1);
        Log.e("Database operations","database created / opened... ");
   }

    //CREATE TABLECLIENT
    @Override
    public void onCreate(SQLiteDatabase db) {

        db.execSQL(QUERY);
        Log.e("Database operations","Table created...");
    }

    //ADD CLIENT
    public void addClientInformations (Integer CIN,String name, String surname,String email,Integer phone,String password, String vehType,String vehModel, SQLiteDatabase db){

        ContentValues contentValues = new ContentValues();
        contentValues.put(TablesDB.NewClientInfo.COL_1,CIN );
        contentValues.put(TablesDB.NewClientInfo.COL_2,name );
        contentValues.put(TablesDB.NewClientInfo.COL_3,surname );
        contentValues.put(TablesDB.NewClientInfo.COL_4,email );
        contentValues.put(TablesDB.NewClientInfo.COL_5,phone );
        contentValues.put(TablesDB.NewClientInfo.COL_6,password );
        contentValues.put(TablesDB.NewClientInfo.COL_7,vehType );
        contentValues.put(TablesDB.NewClientInfo.COL_8,vehModel );
        db.insert(TablesDB.NewClientInfo.TABLE_NAME,null,contentValues);

        Log.e("Database operations","One row inserted..."); 

    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}

用它替换您的 addClientMethod。

 public void addClientInformations (Integer CIN,String name, String surname,String email,Integer phone,String password, String vehType,String vehModel){

        SQLiteDatabase db=getWritableDatabase();


        ContentValues contentValues = new ContentValues();
        contentValues.put(TablesDB.NewClientInfo.COL_1,CIN );
        contentValues.put(TablesDB.NewClientInfo.COL_2,name );
        contentValues.put(TablesDB.NewClientInfo.COL_3,surname );
        contentValues.put(TablesDB.NewClientInfo.COL_4,email );
        contentValues.put(TablesDB.NewClientInfo.COL_5,phone );
        contentValues.put(TablesDB.NewClientInfo.COL_6,password );
        contentValues.put(TablesDB.NewClientInfo.COL_7,vehType );
        contentValues.put(TablesDB.NewClientInfo.COL_8,vehModel );
        db.insert(TablesDB.NewClientInfo.TABLE_NAME,null,contentValues);

        Log.e("Database operations","One row inserted...");

    }