SQLiteDatabase db = helper.getWritableDatabase(); db.execSQL("insert into person(name,phone,amount) values(?,?,?) ", new Object[]{person.getName(),person.getPhone(),person.getAmount()}); Cursor cursor = db.rawQuery("select last_insert_rowid() from person",null); int strid; if(cursor.moveToFirst()) strid = cursor.getInt(0); Log.i("testAuto", strid+"");
收藏
0人收藏
- 2014-11-04 10:01:01Android开发中从SQLite数据库获取新插入数据自增长的ID值 by 吴红军
- 2012-11-02 22:25:14android读取apk中已经存在的数据库信息 by 格格巫2012
- 2013-03-19 13:35:22C# 在SQLite数据库中存储图像 by 南宫傲
- 2012-11-05 09:38:43c++操作sqlite3数据库示例(命令行电话薄) by 山药
- 2013-05-06 21:15:48python操作sqlite3数据库完全代码 by 文丐
- 2014-09-07 11:17:56python从sqlite读取数据并显示 by 逆风扬
- 2012-11-08 17:42:49ruby连接sqlite by 金背二郎
- 2013-05-09 14:27:06android绑定sqlite数据库与程序一起发布 by xuleaper
- 2014-09-30 10:03:54python在sqlite动态创建表代码 by 自由魂
- 2012-11-08 17:59:27ruby连接数据库总结 by 金背二郎
- 2019-02-13 14:14:06Java的用途有哪些? by edulofter
相关聚客文章