# decryptDatabase=true attribute

The decryptDatabase=true attribute returns an encrypted database to an unencrypted state.

For information about data encryption, see "Configuring database encryption" in the Derby Security Guide.

You must shut down the database before you decrypt it. An attempt to decrypt a booted database has no effect.

Specifying this attribute for an unencrypted database has no effect.

## Combining with other attributes

The decryptDatabase=true attribute must be combined with either the bootPassword=key attribute or the encryptionKey=key attribute.

For an existing, encrypted database for which authentication and SQL authorization are both enabled, only the database owner can perform decryption. See "Configuring user authentication" and "Configuring user authorization" in the Derby Security Guide for more information.

After you decrypt the database, be sure to check for SQLWarnings. The decryption succeeded only if there were no SQLWarnings or SQLExceptions.

## Examples

    -- decrypt a database
    jdbc:derby:encryptedDB;decryptDatabase=true;bootPassword=cLo4u922sc23aPe
    -- decrypt a database with authentication and SQL authorization enabled
    jdbc:derby:salesdb;decryptDatabase=true;user=user1;password=mypass;
        bootPassword=cLo4u922sc23aPe

Parent topic: Setting attributes for the database connection URL