To start Derby, you start the Derby JDBC driver. Starting the Derby driver starts up the complete Derby system within the current JVM.
For example, when using the JBDC driver manager directly within Java code, you typically start a JDBC driver in one of these ways:
java -Djdbc.drivers=org.apache.derby.jdbc.EmbeddedDriver applicationClass
For more details, see "java.sql.Driver" in the Derby Reference Manual.
Once the Derby JDBC driver class has been loaded, you can connect to any Derby database by passing the embedded connection URL with the appropriate attributes to the DriverManager.getConnection method.
Connection conn = DriverManager.getConnection("jdbc:derby:sample");