drop=true attribute

The drop=true attribute removes the in-memory database specified within the database connection URL.

The attribute generates the SQLException 08006 if successful. If the database does not exist, it 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.

If you specify this attribute with a database that is not an in-memory database, Derby generates the SQLException XBM0I.

Combining with other attributes

If authentication is turned on, you must specify this attribute in conjunction with the user=userName and password=userPassword attributes. If both authentication and SQL authorization are turned on, the user must be the database owner.

Examples

-- drop an in-memory database using the embedded driver
jdbc:derby:memory:myInMemDB;drop=true
-- drop an in-memory database using the Network Server
jdbc:derby://localhost:1527/memory:myInMemDB;drop=true