Skip to main content

Connecting to an embedded Derby database from another process

Posted by davidvc on May 17, 2007 at 12:44 PM PDT

A common question we get on the derby-user list is how to talk to a Derby database running in embedded mode from a separate client, such as a report tool or visual query tool.

You can do this by
starting a network server
in the same VM as the embedded database.

The code is pretty simple

import org.apache.derby.drda.NetworkServerControl;
NetworkServerControl server = new NetworkServerControl

Then you just connect to it using the standard network client URL, e.g. "jdbc:derby://localhost:1527/sample"