Android 在模拟器上显示数据库中提取的信息的列表
2010-11-05 00:56:33 来源:WEB开发网db.beginTransaction();// 开始事务
try {
for(int i=0;i< 100;i++){
db.execSQL("insert into person(name,age) values(?,?)",
new Object[] { person.getName(), person.getAge() });
}
db.execSQL("insert into personww(namedd,age) values(?,?)",
new Object[] { person.getName(), person.getAge() });
db.setTransactionSuccessful();
} catch (Exception e) {
//db.endTransaction();// 事务结束;
Log.i("aa","wwwwwwwwwwwwwwwwwwwwwwwww");
}
db.endTransaction();// 事务结束;
Log.i("aa", "55555555555555555555");
}
public void save1(Person person) {
SQLiteDatabase db = databaseHelper.getWritableDatabase();
db.beginTransaction();// 开始事务
Log.i("aa", "uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu");
try {
db.setTransactionSuccessful();
db.execSQL("insert into person(name,age) values('Tom',21)");
} catch (Exception e) {
Log.i("aa", "trttttttttttttttttttttttttttttttttttttttttttttt");
}
db.endTransaction();// 事务结束;
}
public void save2(Person person) {
SQLiteDatabase db = databaseHelper.getWritableDatabase();
db.beginTransaction();// 开始事务
Log.i("aa", "uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu");
try {
db.setTransactionSuccessful();
for(int i=0;i< 100;i++){
db.execSQL("insert into person(name,age) values(?,?)",
new Object[] { person.getName(), person.getAge() });
}
} catch (Exception e) {
Log.i("aa", "trttttttttttttttttttttttttttttttttttttttttttttt");
}
db.endTransaction();// 事务结束;
}
public void update(Person person) {
SQLiteDatabase db = databaseHelper.getWritableDatabase();
更多精彩
赞助商链接