Derby Java SQL异常 [英] Derby java sql exception

查看:87
本文介绍了Derby Java SQL异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Glassfish 4服务器上启动应用程序,但是它给了我一些奇怪的异常:
内部异常:java.sql.SQLException:分配连接时出错。原因:无法分配连接,原因是:java.net.ConnectException:错误消息连接到端口1527上的服务器localhost时出现连接被拒绝的错误:连接。
可能是因为我没有SQL?我不确定如何解决它。

I am trying to start an application on Glassfish 4 server but it gives me some strange exception: Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect. Could it be because I don't have SQL? I am not sure how to fix it.

推荐答案

您需要启动Derby Network Server,并让其侦听端口1527。在本地主机上(这是Derby Network Server的默认设置,因此不需要特殊配置即可实现该主机和端口)。

You need to start the Derby Network Server, and have it listen on port 1527 on localhost (which is the default setting for the Derby Network Server, so no special configuration is required to achieve that host and port).

您可以找到启动说明。 Derby网络服务器在这里: http://db.apache.org/derby /docs/10.11/adminguide/tadmincbdjhhfd.html

You can find the instructions for starting the Derby Network Server here: http://db.apache.org/derby/docs/10.11/adminguide/tadmincbdjhhfd.html

如果您刚开始使用Derby,可以在此处了解更多信息: http://db.apache.org/derby/docs/10.11/getstart/

If you are just getting started with Derby, you can learn more here: http://db.apache.org/derby/docs/10.11/getstart/

这篇关于Derby Java SQL异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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