-->

How to create database using Db4o in android?

2019-05-25 23:51发布

问题:

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.