Our recommended manner, because it ensures that the class is loaded in all JVMs by creating an instance at the same time.
Same as Class.forName("org.apache.derby.jdbc.EmbeddedDriver"), except that it requires the class to be found when the code is compiled.
This is also the same as Class.forName("org.apache.derby.jdbc.EmbeddedDriver"), except that it requires the class to be found when the code is compiled. The pseudo-static field class evaluates to the class that is named.
To set a System property, you alter the invocation command line or the system properties within your application. It is not possible to alter system properties within an applet.
java -Djdbc.drivers=org.apache.derby.jdbc.EmbeddedDriver applicationClass
The actual driver that gets registered in the DriverManager to handle the jdbc:derby: protocol is not the class org.apache.derby.jdbc.EmbeddedDriver; 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.