WEB开发网
开发学院手机开发Android 开发 Android 在模拟器上显示数据库中提取的信息的列表... 阅读

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(), pe

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();

上一页  1 2 3 4 5 6  下一页

Tags:Android 模拟器 显示

编辑录入:coldstar [复制链接] [打 印]
赞助商链接