Does Derby Server work for you?
It is possible that you are trying to connect to a database without a real server running on port 1527.
You can try to establish a connection using the command line / Linux shell - depending on which operating system you are using.
Try it if you want:
- Open command prompt
- Go to the Derby installation directory
- Go to the bin directory (Note: go to the networkServer folder, if one exists)
- Type "startNetworkServer" and press Enter
You should receive a message that says:
2012-08-29 10: 57: 16.559 GMT: The security manager is installed using the security policy of the primary server. 2012-08-29 10: 57: 16.809 GMT: Apache Derby Network Server - 10.6.2.1 - (999685) is running and ready to accept connections on port 1527
If you do not, perhaps you can check your firewall (comments here :)
If you do this, you can test your connection using the following method:
If all goes well, you will receive an "ij>" prompt.
Here you can enter some SQL queries to further test the connection.
If not, then there may be other problems.
If you are creating a database for the first time in a derby, you will have to use this instead of step 5 above:
connect 'jdbc:derby://localhost:1527/MyDB;create=true';
... and press Enter
Hopefully after completing these steps you will get a connection. In the latter case, you will at least get a new MyDB database that is active on Derby Server. If your source database (MyDB) is relatively small, it might be faster to restore it again for whatever purpose you need.
In addition to this, if you have established a connection, you can try other tools that you use to develop the database, since you have at least eliminated the possibility that the connection is a problem.
Just make sure the port number is listed in step 4. Usually it is 1527. If not, change the port number in step 5 (or its replacement command for the new database) for any port specified in the message from Derby.
Hope this helps and good luck :)
Wayne Rister