Java Desktop Application using SQLite installed by a single installer

杀马特。学长 韩版系。学妹 提交于 2019-12-09 18:21:47

问题


I am a beginner in programming Java Desktop Application interacting with databases. My goal is to make a simple java application which uses a database to store it's data locally. After some googling I found that SQLite/Derby would cover my needs.

I've googled SQLite and Derby and I found that in order to use them I need to install them on the computer through commands in terminal.

My question is how the application could be done so that at the end the client will be given a simple installer file which installs both Java Application and the SQLite/Derby Database avoiding doing any installations before.

Is that possible?


回答1:


I think the easyest for you is to use the database in embedded mode. Different databases could be use in this way :

  • Derby
  • SQLLite and for more details you could at this answer
  • HSQLDB

The database is packaged with your application jar, so you don't need to install it.




回答2:


You could write a script (e.g. bash script on UNIX) which checks if the DB is installed, installs it if needed and runs the .jar file of your program. On windows you can achieve the same with a batch script. So the user would only have to execute the script.



来源:https://stackoverflow.com/questions/12158304/java-desktop-application-using-sqlite-installed-by-a-single-installer

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