Working with the database connection URL attributes
You specify attributes on the Derby connection
The examples in this section use the syntax of the connection URL for use
in an embedded environment. You can also specify these same attributes and
values on the client connection URL if you are using Derby as
a database server. For more information, see the Java DB Server and Administration Guide.
Using the databaseName attribute
You can use a databaseName attribute on a database connection URL to specify the name of the database to which you want to connect.
Shutting down Derby or an individual database
Applications in an embedded environment shut down the Derby system by specifying the shutdown=true attribute in the connection URL. To shut down the system, you do not specify a database name, and you do not ordinarily specify any other attribute.
Providing a user name and password
When user authentication is enabled, an application must provide a user name and password. One way to do this is to use the user=userName and password=userPassword connection URL attributes.
Encrypting a database when you create it
If your environment is configured properly, you can create your database as an encrypted database (one in which the database is encrypted on disk). To do this, you use the dataEncryption=true attribute to turn on encryption and the bootPassword=key attribute or the encryptionKey attribute to specify a key for the encryption.
Booting an encrypted database
You must specify several attributes in the URL when you boot an encrypted database. You must specify these attributes the first time that you connect to the database within a JVM session, or after you shut the database down within the same JVM session.
Specifying attributes in a properties object
Instead of specifying attributes on the connection URL, you can specify attributes as properties in a Properties object that you pass as a second argument to the DriverManager.getConnection method.