如何在Android中使用db4o中创建数据库? [英] How to create database using Db4o in android?

查看:111
本文介绍了如何在Android中使用db4o中创建数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序中,现在我要为更多更好的用户体验创建数据库。后来我才知道的db4o这是许多倍的速度工具,用于创建数据库比其他类似的SQLite,MySQL的等等,但问题是我不能够找到解释关于db4o以及如何使用db4o的创建数据库的一个例子。如果有人使用了它,请发表一个例子或给我联系。

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.

推荐答案

要存储对象的数据库的使用

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

如果你需要的例子,我尝试博客例如使用db4o的。
在这个例子中,简单的学生对象将使用的db4o 存储在数据库中。学生对象将包含学生姓名,注册号和他的年龄。

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.

感谢您。

这篇关于如何在Android中使用db4o中创建数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆