db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen" <Bernt.John...@Sun.COM>
Subject Re: Connection refused
Date Wed, 06 Jun 2007 10:29:04 GMT

>>>>>>>>>>>> Steve Pannier wrote (2007-06-05 10:28:18):
> Hi all.
> I'm trying to access the network server using the network client driver.
> I connect to my database from a remote client and keep getting the
> connection refused error.  Even when I connect from the local system, I
> get the error (in certain cases - see below).  I'm trying to figure out
> if I'm using the wrong derby URL, or if this is caused by some sort of
> network issue in my work environment.
> My network server is running on port 10222.  From the same system, I use
> setNetworkClientCP to set the classpath for my client.  When I run 'ij'
> and connect to the database it works OK for the following:
> connect 'jdbc:derby://localhost:10222/<database>';
> connect 'jdbc:derby://<hostname>:10222/<database>';
> But it fails when I use:
> connect 'jdbc:derby://<database>'; (where
> "" is the ip address of localhost)

Stricly, the ip address of "localhost" is allways (the
loopback interface) and Derby will by default listen on that
interface. Thus, you cannot connect from other machines, and you can
not connect on the network interface.

To make Derby listen on all interfaces, start the server with 


You can also make Derby listen on an specific interface, in your case


Hope this helps.

> I am unable to connect successfully from a remote client running 'ij'.
> Before I ask our IT guys here what might be causing this, I wanted to
> make sure I'm using the correct URL in my connect command.  Has anyone
> seen this behavior before?  Can anyone confirm that I'm using the
> correct URL?
> Thanks!
> Steve

Bernt Marius Johnsen, Database Technology Group, 
Staff Engineer, Technical Lead Derby/Java DB
Sun Microsystems, Trondheim, Norway

View raw message