如何包括数据库到我的应用程序 [英] How to include database into my app

查看:142
本文介绍了如何包括数据库到我的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为妻子做了一个应用程序,帮助她做她的工作。应用程序正在使用mysql来保存所有数据。如何使这个应用程序使用数据库,而没有在PC上安装mysql。如果mysql不是一个选项,什么是?我的目标与Android应用程序(.db文件或类似)类似。

I've made a an app for my wife to help her for the work she does. App is using mysql to save all data. How to make this app use database without having mysql installed on the pc. If mysql is not an option, what is? My target is similar to android apps(.db file or similar).

推荐答案

您可以使用 H2 embeddable database 。它作为一个单一的jar,可以包括在你的应用程序(包括其中的一切,包括驱动程序和引擎)。数据将被写入磁盘上的给定位置(db文件),因此存储的数据也是可移植的。 H2是相当健壮,并支持标准的SQL查询。这是这种用例的常用选择。

You can use the H2 embeddable database for this case. It comes as a single jar which can be included in your app (has everything in it including the driver and engine). The data will be written to a given location on disk (db file) so the data stored is also portable. H2 is quite robust and supports the standard SQL queries. It's a popular choice for such use cases.

这篇关于如何包括数据库到我的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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