db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damian Carey" <jami...@gmail.com>
Subject Connecting to Server from remote PC
Date Mon, 22 Dec 2008 03:22:15 GMT
Hello,

I've been investigating using Derby, as it would seem to have an ideal
fit for our use.
We have a Distributed Java-Swing desktop app using Hibernate and
persisting in Postgres.  The app may be on more that one PC, so we
have RMI and database connections between machines. So we do have some
experience getting clients and servers to talk across the network.

I am pretty happy with how things are going - except that I can only
get them going on "localhost".

Consequently I have reverted back to the Derby examples and tools such
as "ij" to try to get communication happening.
I have also (unplugged the internet then) turned off all firewalls to
presumably let everything through.

I do notice that in the Derby documentation there are lots of client
examples using "localhost" but few examples for connecting to servers
on different machines.

Can anyone suggest ways to get this connection happening????
I guess the syntax is wrong???

On "PC-1" - everything is fine, but I cant connect from "PC-2"!

Below I have included the basic syntax that I was using.

I would greatly appreciate any suggestions or advice.

Thanks,
-Damian


===== PC-1 >>>>>

PC-1-SHELL-1> startNetworkServer -h 0.0.0.0
Security manager installed using the Basic server security policy.
Apache Derby Network Server - 10.4.2.0 - (689064) started and ready to
accept connections on port 1527 at 2008-12-22 02:14:30.703 GMT

PC-1-SHELL-2> ij
ij> CONNECT 'jdbc:derby://localhost:1527/thirddb;create=true';
ij> CREATE TABLE THIRDTABLE (ID INT PRIMARY KEY, NAME VARCHAR(14));
ij> INSERT INTO THIRDTABLE VALUES (100,'ONE HUNDRED'), (200,'TWO
HUNDRED'),(300,'THREE HUNDRED');
3 rows inserted/updated/deleted

PC-1-SHELL-3> ij
ij> CONNECT 'jdbc:derby://localhost:1527/thirddb';
ij> SELECT * FROM THIRDTABLE ;
ID         |NAME
--------------------------
100        |ONE HUNDRED
200        |TWO HUNDRED
300        |THREE HUNDRED

======= PC 2 >>>>>>

PC-2-SHELL-1> ij
ij> CONNECT 'jdbc:derby://192.168.1.2:1527/thirddb';
ij> SELECT * FROM THIRDTABLE ;
ERROR 08001: java.net.ConnectException" Error connecting to server
192.168.1.2 on port 1527 with message Connection refused: connect.

Mime
View raw message