问题
I am using JavaDB for the first time and I am having trouble getting my program to run. Whenever I run it I get this error:
"Error connecting to server localhost on port 1527 with message Connection refused: connect"
My database and code are all setup okay as when I ran it on someone elses computer it worked fine, but on mine it doesn't. I'm using Netbeans 7.3.1 as that is the version I have to use for school. I am not sure what is causing this and I could really use some help. If you have any questions or want me to post some code just let me know.
Thanks
回答1:
Have you checked the status of that port 1527 on your PC?
On windows:
netstat -an | find ":PORT_NUMBER"
and on Linux:
netstat -an |grep PORT_NUMBER
If it turns out it is used by some other application you can do one of two things:
1) Free the port
2) Change the port your app is running on
It might also be possible, that JavaDB is running on a different port and another you will have to either change it in DB or your app anyway.
EDIT: Here are another ways of checking the port How to determine if a port is open on a Windows server?
回答2:
Did you install it? Is the process running?
来源:https://stackoverflow.com/questions/25141733/javadb-having-port-connection-error