You need to run Derby in "embedded server" mode. If you are already using Derby in native mode, you can enable this by providing the necessary files in your class path, and then specifying a few command line arguments when starting the application.
First, make sure that the following banks are in your runtime execution path.
derby.jar derbynet.jar
Then add the following command line parameters to the Java command used to start the application. If class files are missing, these options will have no effect.
-Dderby.drda.startNetworkServer=true -Dderby.drda.portNumber=8011
I run Derby from a servlet hosted by Tomcat, so I added these parameters to the catalina.bat file.
Launch the application and check the list of open network sockets.
netstat -an | find "8011"
Now you will see that Derby is listening on connections on 8011. Now it can be connected to the database using the Derby client driver (derbyclient.jar). The instructions at http://docs.oracle.com/javadb/10.3.3.0/adminguide/radminembeddedserverex.html very well reflect this part.
It was suggested that launching Derby in this mode might be discouraged. I do not think so. Your application will continue to access the database using the built-in driver, while other software is now allowed to access using the client driver.
trooper
source share