user2971184
user2971184

Reputation: 39

How to access derby database in another system from current system?

I just want to access the database in another system from current system. In that second system, i had already created a derby database which is in built in netbeans. I tried to access that database by changing the ip address instead of localhost in "jdbc:derby://localhost:1527/course".

But it shows java.net.ConnectException: Error connecting to server 10.6.3.3 on port 1527 with message connection timed out. How can i resolve this.. Please help me

Upvotes: 2

Views: 2501

Answers (1)

Alireza Ensafi
Alireza Ensafi

Reputation: 21

You can run derby on two ways : embedded or server.

so first step is you need to run derby on server mode.However by running derby on server mode still only localhost can have access to database.

To give access to other IP's you need to run server with option : -h "0.0.0.0"

  • On windows : /pathtoderby/bin/startNetworkServer.bat -h "0.0.0.0"

  • On linux : /pathtoderby/bin/startNetworkServe.ksh =h "0.0.0.0"

Note: the reason you should not allow network access is security as derby is single user and plain text. before over network access make sure to read this topics to make sure you give secure access :

http://db.apache.org/derby/papers/DerbyTut/ns_intro.html

Upvotes: 2

Related Questions