转载:http://www.thinksaas.cn/group/topic/83748/
http://www.cnblogs.com/zhangs1986/p/3744756.HTML
http://blog.csdn.net/sgx425021234/article/details/9018387
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.thundersoft.kIDs2/com.thundersoft.kIDs2.activity.MainActivity}: androID.database.sqlite.sqliteException: near "tabletb_contacts": Syntax error (code 1):,while compiling: create tabletb_contacts(_IDinteger primary key autoincrement,nametext not null,phonetext not null);解决:sql 语句出错java.lang.RuntimeException: Unable to start activity ComponentInfo{com.thundersoft.kIDs2/com.thundersoft.kIDs2.activity.MainActivity}: androID.database.sqlite.sqliteException: near "tabletb_contacts": Syntax error (code 1):,phonetext not null);<pre name="code" >解决:sql 语句出错java.lang.RuntimeException: Unable to start activity ComponentInfo{com.thundersoft.kIDs2/com.thundersoft.kIDs2.activity.MainActivity}: java.lang.IllegalStateException: attempt to re-open an already-closed object: sqliteDatabase: /data/data/com.thundersoft.kIDs2/databases/contacts_database解决:再次使用数据库时,没有打开数据库
update 关键字里没有 and!!,new String[]{contact.getname(),contact.getPhone(),String.valueOf(contact.getID())});正确:mDatabase.execsql("update "+table_name+" set name = ?,phone = ? where _ID =?",String.valueOf(contact.getID())});
if(tmpList == null || tmpList.size() ==0){ Contact contactOne = new Contact("Zhangs","123456789"); Contact contactTwo = new Contact("lis","456789123"); Contact contactThree = new Contact("Wangw","789456123"); simpleContactList = new ArrayList<Contact>(); simpleContactList.add(contactOne); simpleContactList.add(contactTwo); simpleContactList.add(contactThree); //插入 mDatabaseUtil.insertContactList(simpleContactList); //自动生成得ID 第一次没有读取到 simpleContactList = mDatabaseUtil.findAllContact();总结
以上是内存溢出为你收集整理的androi 原声sqlite *** 作全部内容,希望文章能够帮你解决androi 原声sqlite *** 作所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)