用于 Java 桌面应用程序的最佳数据库是什么
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2733688/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the best database to use for a Java desktop application
提问by blow
Which of the following databases is best for a big desktop application: Firebird, JavaDB, hsqldb ? I need performance, easy of use, and totally free license.
以下哪个数据库最适合大型桌面应用程序:Firebird、JavaDB、hsqldb?我需要性能、易于使用和完全免费的许可证。
采纳答案by Pascal Thivent
If you're looking for an embeddable database, my recommendation would be H2(stands for Hypersonic 2, (re)written by the author of HSQLDB). See the detailed comparison of featuresand of performances.
如果您正在寻找可嵌入的数据库,我的建议是H2(代表 Hypersonic 2,由 HSQLDB 的作者(重新)编写)。请参阅功能和性能的详细比较。
Using a 100% Java database would allow to run it in the same process and make things a lot easier IMO.
使用 100% Java 数据库将允许在同一进程中运行它并使 IMO 变得更容易。
回答by Xorty
Depends on requirements and data amount. My last choice was MySQL and it was very comfortable (swing app)
取决于要求和数据量。我最后的选择是 MySQL,它很舒服(swing 应用程序)
回答by Shay Tsadok
Let me recommend you on Postgres(http://www.postgresql.org/), which is one of the best freeware DB's I know.
让我向您推荐Postgres( http://www.postgresql.org/),这是我所知道的最好的免费软件数据库之一。
I had an experience with this DB in my previous project, in which we held ~20 tables in the schema, the largest table had ~100,000 rows, and the amount of total data was not that big.
我在之前的项目中使用过这个数据库,其中我们在模式中保存了大约 20 个表,最大的表有大约 100,000 行,并且总数据量不是那么大。
This project is running in production for more then 2 years, and there weren't any special problems with it.
该项目在生产环境中运行了 2 年多,并没有出现任何特殊问题。
Shay
谢伊
回答by Michael Ekstrand
I think you'll be better off with an embeddable database for this. HSQLDB or H2 would work, as would SQLite. SQLite is quite popular outside the Java world (it's used by the Mozilla project, for instance). I'm not familiar with JavaDB, so I can't speak to its capabilities.
我认为为此使用可嵌入的数据库会更好。HSQLDB 或 H2 可以工作,就像SQLite 一样。SQLite 在 Java 世界之外非常流行(例如,它被 Mozilla 项目使用)。我不熟悉 JavaDB,所以我无法谈论它的功能。
SQLite is known to be pretty fast.
众所周知,SQLite 非常快。
回答by finnw
I would go for a DBMS that is notJava-specific. You may want to share your data with a C++ or .NET application some day. If it does not need to be client/server consider SQLite or H2. If it does then consider Postgres. All of these have ODBC drivers and/or drivers for specific languages other than Java.
我会选择不特定于 Java的 DBMS 。有一天,您可能希望与 C++ 或 .NET 应用程序共享您的数据。如果不需要客户端/服务器,请考虑 SQLite 或 H2。如果是,则考虑 Postgres。所有这些都有 ODBC 驱动程序和/或 Java 以外的特定语言的驱动程序。
回答by Hugues Van Landeghem
回答by Chris
My recommendation is H2. I recently migrated a db (from MS SQL server) including 2 larger tables hosting >2 million rows each. First I tried Derby and had issues (not only performance) - then I switched to H2 and migrated everything successfully.
我的建议是H2。我最近迁移了一个数据库(来自 MS SQL 服务器),其中包括 2 个更大的表,每个表托管 > 200 万行。首先,我尝试了 Derby 并遇到了问题(不仅是性能)——然后我切换到 H2 并成功迁移了所有内容。