How to embed database derby in jar file

家住魔仙堡 提交于 2019-12-24 20:59:52

问题


I do not want to install a database server on target machine. It is possible that we can simply ship a jar file with the database embedded in it, and not worry about installing a database server separately?
I created one application in netbeans using derby and it is working fine in my pc but when i am running on other machine it is giving me Error connecting to server localhost on port 1527 --> this error says that there is no Database running on port 1527. but i dont want that the client should take more efforts to start DB server and all technical process. It should be simply runnable when i start application Derby DB should start and when i close DB should close.
So what will be the solution for my problem?
And one more Question is Can i use derby database for large scale projects?


回答1:


No, you don't have to install a database server on the target machine; Derby works just fine in embedded mode without a separate server.

However, if you want multiple client applications to be actively sharing the same data in the same database, you'll want to use the client-server mode, not the embedded mode.

And yes you can embed a jar with the database into your program. If you want to know how, read this documentation: http://db.apache.org/derby/docs/10.11/devguide/cdevdvlp24155.html

And yes you can use Derby for large scale projects. But it doesn't come with all the enterprise features (online backup, etc.) that a true enterprise scale commercial DBMS comes with.

But, since it sounds like you are just getting started with Derby, can I suggest that you please start with the Derby tutorials before you try these advanced configurations? Here is the link to the Derby tutorials: http://db.apache.org/derby/docs/10.11/getstart/

It may not be possible to give you very good advice without knowing a lot more about the application you're trying to build and the overall architecture you're trying to use.



来源:https://stackoverflow.com/questions/30182333/how-to-embed-database-derby-in-jar-file

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