大佬教程收集整理的这篇文章主要介绍了android中的compileStatement或db.insert,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
String tableNAME = "table"; //fields in table: id,name sqliteStatement statement = db.compileStatement("INSERT INTO "+TABLename+" VALUES(?,?);"); statement.bindLong(1,666); statement.bindString(2,"john"); statement.executeinsert();
要么
String tableNAME = "table"; ContentValues values = new ContentValues(); values.put("id",666); values.put("name","john"); db.insert(TABLename,null,values);
哪一个应该是最佳的?
编辑:-
我正在运行的应用程序是单线程的.
此外,考虑在事务中包装插入以减少等待I / O所花费的时间.
@H_874_2@ @H_874_2@以上是大佬教程为你收集整理的android中的compileStatement或db.insert全部内容,希望文章能够帮你解决android中的compileStatement或db.insert所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。