`
private static final String CREATE_ADS_PICTURE = "CREATE table " + AdsBDD.table_ADS_PICTURE + "(" + AdsBDD.ID_PICS + " INTEGER PRIMARY KEY autoINCREMENT," + AdsBDD.AD_ID + " INTEGER NOT NulL," + AdsBDD.PICTURE + " TEXT," + AdsBDD.FolDER + " TEXT," + AdsBDD.ORDER_NO + " INTEGER NOT NulL);";private static final String CREATE_AGENCES = "CREATE table " + AgencesBDD.table_AGENCES + "(" + AgencesBDD.ID + " INTEGER PRIMARY KEY autoINCREMENT NOT NulL," + AgencesBDD.GROUP + " INTEGER," + AgencesBDD.USERname + " TEXT," + AgencesBDD.EMAIL + " TEXT," + AgencesBDD.CONTACT_name + " TEXT," + AgencesBDD.REGISTRATION_DATE + " TEXT," + AgencesBDD.ACTIVATION + " TEXT," + AgencesBDD.ACTIVE + " INTEGER," + AgencesBDD.STORE + " INTEGER," + AgencesBDD.STORE_BANNER + " TEXT," + AgencesBDD.rating + " REAL," + AgencesBDD.LANGUAGE + " TEXT," + AgencesBDD.IDENTITY + " TEXT," + AgencesBDD.ADDRESS + " TEXT," + AgencesBDD.PHONE + " TEXT," + AgencesBDD.COMPANY + " TEXT," + AgencesBDD.WEBPAGE + " TEXT," + AgencesBDD.CODE_POSTAL + " TEXT," + AgencesBDD.JE_SUIS_UN + " TEXT," + AgencesBDD.VILLE + " TEXT," + AgencesBDD.VIDEO + " TEXT);"; @OverrIDepublic voID onCreate(sqliteDatabase db) { db.execsql(CREATE_ADS_PICTURE); db.execsql(CREATE_AGENCES);} public class AgencesBDD {public static final String table_AGENCES = "agences";public static final String ID = "ID";public static final String GROUP = "group";public static final String USERname = "username";public static final String EMAIL = "email";public static final String CONTACT_name = "contact_name";public static final String REGISTRATION_DATE = "registration_date";public static final String ACTIVATION = "activation";public static final String ACTIVE = "active";public static final String STORE = "store";public static final String STORE_BANNER = "store_banner";public static final String rating = "rating";public static final String LANGUAGE = "language";public static final String IDENTITY = "IDentity";public static final String ADDRESS = "address";public static final String PHONE = "phone";public static final String COMPANY = "company";public static final String WEBPAGE = "webpage";public static final String CODE_POSTAL = "code_postal";public static final String JE_SUIS_UN = "je_suis_un";public static final String VILLE = "ville";public static final String VIDEO = "vIDeo";
`
所以问题是sqlite为表AGENCES抛出了这个异常,但表AD_PICTURE工作正常:
03-08 14:36:01.892: E/AndroIDRuntime(10822): FATAL EXCEPTION: main03-08 14:36:01.892: E/AndroIDRuntime(10822): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.infonetdiffusion.immohabitation/com.infonetdiffusion.immohabitation.FragmentBaseActivity}: androID.database.sqlite.sqliteException: near "group": Syntax error (code 1):,while compiling: CREATE table agences(ID INTEGER PRIMARY KEY autoINCREMENT NOT NulL,group INTEGER,username TEXT,email TEXT,contact_name TEXT,registration_date TEXT,activation TEXT,active INTEGER,store INTEGER,store_banner TEXT,rating REAL,language TEXT,IDentity TEXT,address TEXT,phone TEXT,company TEXT,webpage TEXT,code_postal TEXT,je_suis_un TEXT,ville TEXT,vIDeo TEXT);
它应该很容易修复,但我找不到我错了…
任何帮助将是apreciated!
以上是内存溢出为你收集整理的android – Sqlite异常,语法错误全部内容,希望文章能够帮你解决android – Sqlite异常,语法错误所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)