deregister=false attribute The deregister=false attribute, 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. deregister=false database connection URL attribute embedded driverderegistering driverderegistering embedded attributesderegister

You initially register the embedded driver by calling a DriverManager method such as DriverManager.getDrivers() or DriverManager.getConnection().

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 by issuing a call to DriverManager.getConnection().

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 by calling DriverManager.getConnection().

This attribute has no meaning if it is used with the network driver.

Combining with other attributes

This attribute is valid only when issued in conjunction with the shutdown=true attribute.

Examples -- shut down salesDB and deregister the driver jdbc:derby:salesDB;shutdown=true -- shut down salesDB, but do not deregister the driver jdbc:derby:salesDB;shutdown=true;deregister=false