Derby 服务器连接已存在

发布于 2024-11-17 22:25:13 字数 61 浏览 8 评论 0 原文

在我的应用程序中,我需要检查 Derby 服务器是否已在运行,如果没有则启动服务器。有人能告诉我如何检查吗?

In my application I need to check whether the Derby server is already running, and if not start the server. Can anybody tell me how to check that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

执着的年纪 2024-11-24 22:25:13

我能想到的最简单的方法是检索 Derby Connection。如果检索连接时抛出异常,则该连接很可能不存在,您可以启动一个。

The simplest way I can think of is to retrieve a Derby Connection. If there's an exception thrown by retrieving the connection, chances are the connection doesn't exist and you can start one.

固执像三岁 2024-11-24 22:25:13

There is also a 'ping' command available through the NetworkServerControl class: http://db.apache.org/derby/docs/10.8/publishedapi/jdbc4/org/apache/derby/drda/NetworkServerControl.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文