与应用程序一起打包的最轻的数据库 [英] Lightest Database to be packed with an application
问题描述
我正在开发一个 Java 桌面应用程序,并且想要一个可以与 Hibernate
一起使用并且可以与应用程序一起打包的 轻量级数据库
.
I am developing a Java Desktop Application and want a light database
that can be used with Hibernate
and that can be packed with an application.
我打算使用 Derby
数据库.它的大小接近 2 MB.但在此之前,我想听听专家对 SO 的看法.
I was going to use Derby
database. It's size is near 2 MB. But before that I wanted to have views of experts on SO.
它是否适用于 Hibernate
?
实际上,我是 Hibernate 的新手,正在研究它需要 Dialect
用于数据库,所以 Hibernate 有 Derby
的方言吗?
Actually, I am new to Hibernate and was studying that it requires a Dialect
for a database so Is Hibernate has dialect for Derby
?
推荐答案
JavaDB(Sun 支持的开源 Apache Derby 发行版)、HSQLDB(不是很活跃)和
JavaDB (Sun's supported distribution of the open source Apache Derby), HSQLDB (not very active) and H2 (the successor of HSQLDB) are all 100% Java embeddable database engines and can all be used with Hibernate (i.e. there are dialect for them). Refer to this page and this one.
HSQLDB 的占用空间最小(~700 KB).但在功能方面(请参阅此比较),H2 是明显的赢家及其足迹(~1 MB) 仍然比 Derby 的 (~2 MB) 小.
HSQLDB has the smallest footprint (~700 KB) of all of them. But feature wise (see this comparison), H2 is the clear winner and its footprint (~1 MB) is still smaller than Derby's one (~2 MB).
最终选择取决于您的需求,但 H2 是功能和大小的良好折衷(换句话说,是一个大竞争对手).看看上面提到的比较.
The final choice depends on what you need but H2 is a good compromise of features and size (in other words, a big competitor). Have a look at the mentioned comparison.
这篇关于与应用程序一起打包的最轻的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!