Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting a connection to a remote Derby server database.

angelo moreschini
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm new here so, first, I want to greet everyone.

This is my problem:
In a program that is installed on a computer, part of a local network, I tried, many time and without success, to get a SQL connection to another computer of the same net where is running a Derby server database.

I have not a big experience with a such kind of problem; that is way I think that not all that I wrote in the code can be exact and so I hope to have some help to correct it.

In my work I start the server, at run time, from a program installed on the same computer where the database is stored, using this code:

I get this feed back, when the code run and the server starts:

=============( S E R V E R  is  S T A R T E D): =============
InetAddress : zorro/
Informazioni di runtime :
--- Informazioni di runtime sul server di rete Derby ---
---------- Informazioni di sessione ---------------
N. sessioni :1
N. thread di collegamento : 1
N. sessioni attive : 1
N. sessioni in attesa : 0
Memoria totale : 16318464    Memoria disponibile : 14913416
N.B. Zorro is the name of the computer in the local Network.

After that the server started, they are not problems to get a connection and to use the database in the same program that started the server (i.e. in the same computer where the database is stored).

But if I try to have a connection from a program that is installed on another computer, part of the same local network, always I get this error:

ava.sql.SQLNonTransientConnectionException: : Error connecting to server on port 1527 with message Connection refused: connect.

To get the remote connection (in the method DriverManager.getConnection(connectionURL)), I use this string argument:

The firewall is disabled, the problem cannot depend to this cause.

I hope to have some advice to solve my problem.

Thank you
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!