如何在jar文件中嵌入数据库derby [英] How to embed database derby in jar file

查看:201
本文介绍了如何在jar文件中嵌入数据库derby的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想在目标计算机上安装数据库服务器。

我使用derby在netbeans中创建了一个应用程序,并且在我的计算机中运行良好,这可能是因为我们可以简单地运送一个嵌入了数据库的jar文件,而不必担心单独安装数据库服务器吗? pc,但是当我在其他计算机上运行时,它给我在端口1527上连接到服务器localhost时出错->该错误表明端口1527上没有运行数据库。,但我不希望客户端花费更多的精力来启动DB服务器和所有技术过程。当我启动应用程序Derby DB应该启动而我关闭DB应该关闭时,它应该可以简单地运行。

那么我的问题的解决方案是什么?

还有一个问题是我可以将derby数据库用于大型项目吗?

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?

推荐答案

不,您不必在目标计算机上安装数据库服务器;在没有单独服务器的情况下,Derby在嵌入式模式下也可以正常工作。

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.

是的,您可以将带有数据库的jar嵌入程序中。如果您想知道如何使用,请阅读以下文档: http:// db。 apache.org/derby/docs/10.11/devguide/cdevdvlp24155.html

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

是的,您可以将Derby用于大型项目。但是它并没有真正的企业级商业DBMS附带的所有企业功能(在线备份等)。

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.

但是,因为听起来像您才刚刚开始使用Derby,我可以建议您在尝试这些高级配置之前先从Derby教程开始吗?这是Derby教程的链接: http://db.apache.org/derby /docs/10.11/getstart/

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.

这篇关于如何在jar文件中嵌入数据库derby的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆