内置数据库的可执行Java应用程序(JAR) [英] Executable Java application (JAR) with database packaged inside
问题描述
我正在使用Swing和MySql开发应用程序.我想将其分发给客户端,他们可以在其终端/PC上运行该应用程序,而不必担心安装MySql和其他技术资料.因此,我想到了将JRE和MySql捆绑在一起,但随后遇到了正确地将Java应用程序与数据库一起分发,它表示不是最好这样做.因为这会增加磁盘上的应用程序大小,所以这显然是一个问题.
I am developing an application with Swing and MySql. I want to distribute it to the clients, where they could run the application on their end/PC without worrying about installing MySql and other technical stuff. So, I thought of bundling JRE and MySql but then I came across Correctly distributing a Java application with database which says it is not preferable to do so. As it would increase the application size on disk, which obviously is an issue.
所以,我的问题是
- 如何实现相同目标,以及应该使用哪些工具和资源.
- SQLite是一个不错的选择吗?
感谢您的帮助.
推荐答案
在我看来,SQLite和Apache Derby( http ://db.apache.org/derby/)对于这样的计划都是有好处的.几年前,我用derby做过这样的事情,但它仍在运行.那时我只是打包了包含jre,程序,libs(罐子)和derby数据文件夹的文件夹.
我记得:sqlite非常易于使用,而derby的学习开销更大.
In my opinion SQLite and Apache Derby (http://db.apache.org/derby/) are both good for such a plan. Some years ago i did such stuff with derby and it's still running. At that time i just packaged the folder that contained the jre, the program, libs (jar's) and the data folder of derby.
As i remember: sqlite was very easy to use whereas derby is more overhead to learn.
这篇关于内置数据库的可执行Java应用程序(JAR)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!