1

I'm running a Derby DB on an Ubuntu Server. When I'm using ij i on the Server i can perfectly connect using localhost.

connect 'jdbc:derby://localhost:1527/MyDB';

But now i want to connect from my DesktopPc.

So i use the IP

jdbc:derby://123.123.123.123:1527/MyDB

But i always get an connection refused or URL invalid Error.

Do I have to change server settings or maybe open a port?

Nakilon
  • 34,866
  • 14
  • 107
  • 142
user2167495
  • 25
  • 1
  • 7

1 Answers1

0

Yes, you probably have to change server settings.

And yes, you may have to open a port.

On your Ubuntu Server, you need to look at how you are starting the Derby Network Server. In particular, you need to look at the '-h' argument to the Network Server. By default, the Network Server will listen on "localhost", which means that you can't connect from any other machine.

http://db.apache.org/derby/docs/10.10/adminguide/tadmincbdjhhfd.html

Note that this is done for security reasons, so if you change the Derby Network Server to allow connections from other machines, you need to ensure that you have an appropriate security configuration to make this safe.

For example, if you have a firewall protecting your Ubuntu Server, you indeed will have to open port 1527 to allow connections to reach the Network Server.

Here are some notes on security settings for the Network Server:

http://db.apache.org/derby/docs/10.10/adminguide/cadminnetservsecurity.html
Bryan Pendleton
  • 16,128
  • 3
  • 32
  • 56