You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Damian Carey <ja...@gmail.com> on 2008/12/22 04:22:15 UTC

Connecting to Server from remote PC

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.

Re: Connecting to Server from remote PC

Posted by Damian Carey <ja...@gmail.com>.
On Tue, Dec 23, 2008 at 4:15 AM, Raymond Kroeker <ra...@raykroeker.com> wrote:
> Damian,
>
>  Could you also run a netstat -an on pc-1; and a tracert (or
> traceroute depending on your platform) and paste the relevant results?
>
> Raymond
>
> On Sun, Dec 21, 2008 at 23:33, Valentin Cozma <vc...@elfyard.com> wrote:
>> the syntax is ok,
>>
>> seems you have a network problem.
>>
>> try telnet first.
>>
> ---------------------------------------------------------
> Raymond Kroeker

Many thanks for your interest and help.

I can confirm that it is a local problem. I can do it from PC2-to-PC1,
but not PC1-to-PC2.
It is weird in that the ESET firewall logs that a connection is
requested and allowed on Port 1527, but nothing happens after that. So
it would seem to be deeper within the nether regions of my dev PC.

So neither Derby nor my primitive syntax can be blamed for these woes!

Thanks again,
-Damian

Re: Connecting to Server from remote PC

Posted by Raymond Kroeker <ra...@raykroeker.com>.
Damian,

  Could you also run a netstat -an on pc-1; and a tracert (or
traceroute depending on your platform) and paste the relevant results?

Raymond

On Sun, Dec 21, 2008 at 23:33, Valentin Cozma <vc...@elfyard.com> wrote:
> the syntax is ok,
>
> seems you have a network problem.
>
> try telnet first.
>
>
>



-- 
---------------------------------------------------------
Raymond Kroeker

Re: Connecting to Server from remote PC

Posted by Valentin Cozma <vc...@elfyard.com>.
the syntax is ok,

seems you have a network problem.

try telnet first.