db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: Trouble connecting to Network Server
Date Mon, 26 Jan 2009 20:48:40 GMT
Rafn, Mark wrote:
> ~hey all

Hello Mark,

See my reply below.
> I am now trying to port my application to a multi-user environment 
> using Derby, and I am having some trouble connecting to the server.  I 
> am getting a connection refused error.
> I've read the guides and tried several things with no resolution, so 
> I'm looking for a little hwlp.
> Using Derby
> On the remote computer acting as Server--
> StartNetworkServer starts fine with Basic BuiltIn security.  I have a 
> derby.properties file located in the home directory with the following 
> entries:
>     derby.connection.requireAuthentication=true
>     derby.authentication.provider=BUILTIN
>     derby.user."guest"=guest 
> I know the user is created, because I have to enter the user and 
> password to shutdown.  So from here all appears to be correct.
> I am trying to connect using ij (first off, can ij work with remote 
> databases?).

Yes, ij can work with remote databases. It is a general tool that can 
work with any JDBC driver.

> within ij I set driver=org.apache.derby.jdbc.ClientDriver.  I think I 
> have classpath to all Derby jars correctly.  But when I try to ij> 
> connect 'jdbc:derby://twoenp11/d:/db/bm_db;user=guest;password=guest'; 
> across a WinNT server i get the following error:
> /* ERROR 08001: java.net.ConnectException : Error connecting to server 
> twoenp11 on
> /* port 1527 with message Connection refused: connect.
> twoenp11 is the computer name of the "server" and obviously 
> d:/db/bm_db is the Derby database on the server's D: drive.  The 
> Server is actually another workstation on the network where the 
> StartNetworkServer was launched.  I am successfully using this same 
> workstation as a remote connection using Borland's JDatastore, so it 
> ~should be allowed with Derby(?).

You are not telling us how you start the Derby network server.
By default, it only allows connections from localhost. To allow 
connections from remote hosts, you must specify the interface/ip you 
want Derby to listen on. There is also a special value which makes Derby 
listen on any available interfaces on the machine. This should be in the 
docs, but if you are using NetworkServerControl to start the server, the 
option is -h.


> Any help would be appreciated!
> -mark

View raw message