Suitable database for swing application which does not need server dependancy

心已入冬 提交于 2019-12-11 04:07:06

问题


Which database is suitable for swing desktop application from the followings :?

  1. SQLite
  2. Apache Derby
  3. HyperSQL DB

I want to store my data locally instead of using web service and store for temporary from the above which is lighten local database ?


回答1:


To add to the embedded SQL answer, you can also run the noSQL Neo4J in memory without the need for disk access.

If I remember your previous question, you want to actually ship the data inside the jar, correct? Then you need to ship the data as files and load it into the database each and every time you start the application. That's a massive question and you really need to start reading up on one of the embedded databases mentioned in these answers. You need to look at your data and look at the options then decide which database to use.

Put simply, this will not work with mySQL, you need to use an embedded database. Easiest way would be to

  1. Create and populate it any way you like
  2. Export the data
  3. Store the export file in your jar file.
  4. Write code in your application that a) starts an embedded database on startup b) loads the data from the jar file into it



回答2:


Your created jar can't contain database at all. Solution is to use some kind of embedded database. Have a look at some of these:

  • SQLite
  • Apache Derby
  • HyperSQL DB



回答3:


  1. SQLite is a light weight database but it contains some drawbacks like it is not password protected or encrypted, and you cannot alter the columns in your table.

  2. H2 is also a light weight database which can either be embedded or used on a network. It provides password protection, encryption and also easy to alter the table structure. It is also faster compared to sqlite.

  3. Apache derby - I have no idea.

I prefer H2.



来源:https://stackoverflow.com/questions/19245143/suitable-database-for-swing-application-which-does-not-need-server-dependancy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!