实例教程七:在SQLite中使用事务
生活随笔
收集整理的這篇文章主要介紹了
实例教程七:在SQLite中使用事务
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
系統文件管理器
http://www.eoeandroid.com/thread-128567-1-1.html
android 實現區域截圖
http://www.eoeandroid.com/thread-149439-1-1.html
影院選坐 寫著玩的
http://www.eoeandroid.com/thread-151980-1-1.html
繼上章
1.在數據庫表person添加字段amount
2.在Person類中添加相應的amount
3.在PersonService添加payment()方法
4.初始化amount值,便于調用
public void testUpdateAmount() throws Exception{PersonService service = new PersonService(this.getContext());Person person1 = service.find(1);Person person2 = service.find(2);person1.setAmount(100);person2.setAmount(200);service.update(person1);service.update(person2);}5.在單元測試類PersonServiceTest中添加測試方法testPayment()
public void testPayment() throws Exception{PersonService service = new PersonService(this.getContext());service.payment();}?
?
?
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的实例教程七:在SQLite中使用事务的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 结束SQL阻塞的进程
- 下一篇: IIS+PHP+MYSQL安装配置