java.sql.Driver interface The class that loads 's local JDBC driver is the class org.apache.derby.jdbc.EmbeddedDriver. The class that loads 's network client driver is the class org.apache.derby.jdbc.ClientDriver. java.sql.Driver interface JDBC driverloading

Usually, you will not need to create an instance of one of these classes, because the driver class is loaded and registered automatically when the java.sql.DriverManager class is initialized. That typically happens on the first call to a DriverManager method such as DriverManager.getConnection. This section describes a few exceptions to this rule.

With the embedded driver, if your application shuts down or calls the DriverManager.deregisterDriver method, and you then want to reload the driver, call the Class.forName().newInstance() method to do so:

Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();

You also need to call the Class.forName method in this way if you need to boot the engine without actually connecting to it -- for example, if you want to start an embedded Network Server instance. See, for example, "Overview of the SimpleNetworkServer Sample program" in the .

The actual driver that gets registered in the DriverManager to handle the jdbc:derby: protocol is not the class org.apache.derby.jdbc.EmbeddedDriver or org.apache.derby.jdbc.ClientDriver; that class simply detects the type of driver needed and then causes the appropriate driver to be loaded.

The only supported way to connect to a system through the jdbc:derby: protocol is using the DriverManager to obtain a driver (java.sql.Driver) or connection (java.sql.Connection) through a getDriver or getConnection method call.