Function
If set to true (the default), deregisters the embedded
JDBC driver from the DriverManager after a shutdown, so that the
classes can be
garbage-collected.
You initially register the embedded driver by doing one of the following:
- Call the method
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance().
This mechanism works on all Java Virtual Machines (JVMs) from JDK 1.4 up.
- Set -Djdbc.drivers=org.apache.derby.jdbc.EmbeddedDriver when you
boot the engine's VM,
then call
DriverManager.getConnection().
This mechanism also works on all JVMs from JDK 1.4 up.
- Simply call DriverManager.getConnection(). This mechanism works only
on JDK 6 and up.
Once the embedded driver is registered, you can shut down the
engine by using the
shutdown=true
connection URL attribute. If you also specify deregister=false with the
shutdown URL, the following will happen:
- The embedded driver will remain registered.
- The classes will
not be garbage-collected.
- You can get a
connection just by issuing a call to DriverManager.getConnection(). That
is, you do not need to first call
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance().
In contrast, if you use the default setting of deregister=true when
you shut down the database, the following will happen:
- The embedded driver will be deregistered.
- The classes will be
garbage-collected.
- You will have to call
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance() before
you obtain a new
connection.
This attribute has no meaning if it is used with the network driver.