java.sql.Driver interface

The class that loads Derby's local JDBC driver is the class org.apache.derby.jdbc.EmbeddedDriver. The class that loads Derby's network client driver is the class org.apache.derby.jdbc.ClientDriver. Listed below are some of the ways to create instances of these classes. Do not use the classes directly through the java.sql.Driver interface. Use the DriverManager class to create connections.

If your application runs on JDK 6 or higher, you do not need to do any of the following. The driver will load automatically when your application asks for its first connection.

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 Derby driver needed and then causes the appropriate Derby driver to be loaded.

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

Related reference
java.sql.DriverManager.getConnection method
java.sql.Connection interface
java.sql.DatabaseMetaData interface
java.sql.Statement interface
java.sql.CallableStatement interface
java.sql.PreparedStatement interface
java.sql.ResultSet interface
java.sql.ResultSetMetaData interface
java.sql.SQLException class
java.sql.SQLWarning class
java.sql.Savepoint interface
Mapping of java.sql.Types to SQL types
JDBC Package for Connected Device Configuration/Foundation Profile (JSR 169)
JDBC 4.0-only features
JDBC escape syntax