Using Derby with IDEs

When you use an integrated development environment (IDE) to develop an embedded Derby application, you might need to run Derby within a server framework.

This is because an IDE might try connecting to the database from two different JVMs, whereas only a single JVM instance should connect to a Derby database at one time (multiple connections from the same JVM are allowed).

An "embedded Derby application" is one which runs in the same JVM as the application. Such an application uses the embedded Derby driver (org.apache.derby.jdbc.EmbeddedDriver) and connection URL (jdbc:derby:databaseName). If you use this driver name or connection URL from the IDE, when the IDE tries to open a second connection to the same database with the embedded Derby, the attempt fails. Two JVMs cannot connect to the same database in embedded mode.

Related concepts
Offering connection choices to the user
One Derby instance for each Java Virtual Machine (JVM)
Derby JDBC driver
Derby JDBC database connection URL