background image
<< databaseName=nameofDatabase attribute | encryptionKey=key attribute >>

deregister=false attribute

<< databaseName=nameofDatabase attribute | encryptionKey=key attribute >>
Derby Reference Manual
337
deregister=false attribute
Function
If set to true (the default), deregisters the embedded JDBC driver from the DriverManager
after a shutdown, so that the Derby 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
Derby 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 Derby 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 Derby classes will not be garbage-collected.
· You can get a Derby 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 Derby classes will be garbage-collected.
· You will have to call
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance() before
you obtain a new Derby connection.
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.
Example
-- 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
drop=true attribute
Function
Removes the in-memory database specified within the database connection URL.
Generates the SQLException 08006 if successful. If the database does not exist,
generates an error reporting that the database could not be found.
For a database for which authentication and SQL authorization are both enabled, only the
database owner
can drop that database.
It is not necessary to shut down the database before dropping it.