How to create database using Db4o in android?

北战南征 提交于 2019-12-07 20:58:48

问题


I am developing an App in which now i have to create database for more better user experience. Then i came to know about DB4o which is many times faster tool for creating database than other like SQLite, MySql etc, but the problem is i am not able to find any single example that explains about DB4o and how to create database using Db4o. If anybody has used it, please post an example or send me link.


回答1:


To store the object in database use

db().store(exercise);  

To retrieve All records from database, use

db().query(Object);

To retrieve particular record from database, use

db().queryByExample(Object);

If you need example, Try My blog example using db4o. In this example, simple student object will be stored in database using db4o. Student object will contain student name, register number, and his age.

Thank you.



来源:https://stackoverflow.com/questions/14619588/how-to-create-database-using-db4o-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!