我正在做数据库syn.在sql server和sqlite之间下载数据.如果在sqlite中更新/插入记录时有一些情况,互联网连接速度很慢或者丢失,那么需要回滚.在这段代码中可以使用或者如何在这里使用Transaction.
public void insertTableRecords(String strTableName, String[] strToFields, String[] strValues){
DBAdapter dbAdapter = DBAdapter.getDBAdapterInstance(DownlaodTableActivity.this);
dbAdapter.openDataBase();
ContentValues initialValues = new ContentValues();
for(int i=0 ;i
initialValues.put(strToFields[i],strValues[i]);
}
long n = dbAdapter.insertRecordsInDB(strTableName, null, initialValues);
System.out.println( " -- inserted status : --- " + n);
}
请帮帮我.
提前致谢…