简体   繁体   English

嵌入式数据库的Java桌面应用程序

[英]Java Desktop Application with Embedded Database

i'm planning to start the development of a java desktop application with a database embedded. 我计划开始开发嵌入了数据库的java桌面应用程序。 It will be an application without internet connection and just for that, to insert, update and delete data on the database. 它将是一个没有互联网连接的应用程序,只是为了插入,更新和删除数据库上的数据。 It will be a lot of data. 这将是很多数据。

So, i would like to have your opinions, what libraries should i use to incorporate the database in the application to have good performances in the end? 所以,我想有你的意见,我应该使用哪些库将数据库合并到应用程序中,以便最终获得良好的性能? Should i use jdbc derby that's already incorporated with neatbeans? 我应该使用已经与neatbeans合并的jdbc derby吗?

Thanks in advance! 提前致谢!

Some popular options are: 一些流行的选择是:

  1. HSQLDB HSQLDB
  2. BerkleyDB BerkleyDB
  3. Sqlite 源码
  4. Derby 德比

Its impossible to say if they will be "fast enough", since its all relative. 不可能说它们是否“足够快”,因为它是相对的。 What is fast enough? 什么速度够快? How powerful is the host machine? 主机有多强大? How big is your dataset? 你的数据集有多大? Etc etc. 等等

However, I can say I have seen really good performance from HSQLDB, with fairly large dataset (100K records +) on fairly moderate desktop machines. 但是,我可以说我在HSQLDB上看到了非常好的性能,在相当温和的台式机上有相当大的数据集(100K记录+)。 Sqlite I only explored for android, but its pretty impressive on this platform (considering the hardware it is running on). Sqlite我只针对Android进行了探索,但它在这个平台上相当令人印象深刻(考虑到它运行的硬件)。

I think you should do a little proof of concept, and test them out with some simulated data. 我认为你应该做一些概念验证,并用一些模拟数据测试它们。

I been using Derby in production for years and it works well. 多年来我一直在使用德比生产,效果很好。 The H2 database also looks good, it's supposed to offer better performance than Derby but I haven't used it in production. H2数据库也看起来不错,它应该提供比Derby更好的性能,但我没有在生产中使用它。 Both of these, along with HSQLDB are good choices as they are pure java, all you need to do is bundle the required jar files with your application. 这两个以及HSQLDB都是很好的选择,因为它们是纯java,您需要做的就是将所需的jar文件与您的应用程序捆绑在一起。 Sqlite and Berkely are fine products but not written in Java so I imagine these would be a little more difficult to work with. Sqlite和Berkely是很好的产品,但不是用Java编写的,所以我想这些将会更难以使用。

You don't need any particular libraries. 您不需要任何特定的库。 Each of the above databases should provide a JDBC driver which is the standard way of doing things. 上述每个数据库都应提供JDBC驱动程序,这是标准的处理方式。 You can certainly use an ORM such as Hibernate as mentioned above. 你当然可以使用像上面提到的Hibernate这样的ORM。 This makes some things simpler but if you're just starting out, it might be better to avoid this at first. 这使得一些事情变得更简单,但如果你刚刚开始,最好避免这种情况。

If Derby is available, I would use Derby. 如果Derby可用,我会使用Derby。 HSQLDB is another good option. HSQLDB是另一个不错的选择。 For libraries, I would look at some library for database access. 对于库,我会查看一些库以进行数据库访问。 Spring comes to mind. 春天浮现在脑海中。 If you have control of the database, I would look at an ORM mapping framework such as Hibernate. 如果您可以控制数据库,我会查看一个ORM映射框架,例如Hibernate。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM