background image
<< createFrom=path attribute | deregister=false attribute >>

databaseName=nameofDatabase attribute

<< createFrom=path attribute | deregister=false attribute >>
Derby Reference Manual
336
URL: jdbc:derby:wombat;createFrom=d:/backup/wombat
databaseName=nameofDatabase attribute
Function
Specifies a database name for a connection; it can be used instead of specifying the
database name after the subprotocol.
For example, these URL (and Properties object) combinations are equivalent:
· jdbc:derby:toursDB
· jdbc:derby:;databaseName=toursDB
· jdbc:derby:(with a property databaseName and its value set to toursDB in the
Properties object passed into a connection request)
If you use a subsubprotocol to specify the database (for example, memory for an
in-memory database), include the subsubprotocol as part of the databaseName attribute
specification. For example:
jdbc:derby:;databaseName=memory:myDB
If the database name is specified both in the URL (as a subname) and as an attribute,
the database name set as the subname has priority. For example, the following database
connection URL connects to toursDB:
jdbc:derby:toursDB;databaseName=flightsDB
Allowing the database name to be set as an attribute allows the getPropertyInfo method
to return a list of choices for the database name based on the set of databases known to
Derby. For more information, see
java.sql.Driver.getPropertyInfo method
.
Combining with other attributes
You can combine this attribute with all other attributes.
jdbc:derby:;databaseName=newDB;create=true
dataEncryption=true attribute
Function
Specifies data encryption on disk for a new database or to configure an existing
unencrypted database for encryption. For information about data encryption, see
"Encrypting databases on disk" in the Derby Developer's Guide.
Combining with other attributes
The dataEncryption attribute must be combined with the
bootPassword=key
attribute
or the
newEncryptionKey=key
attribute. You have the option of also specifying the
encryptionProvider=providerName
and
encryptionAlgorithm=algorithm
attributes.
For an existing, unencrypted database for which authentication and SQL authorization
are both enabled, only the
database owner
can perform encryption. See also "Enabling
user authentication" and "Setting the SQL standard authorization mode" in the Derby
Developer's Guide
for more information.
Examples
-- encrypt a new database
jdbc:derby:encryptedDB;create=true;dataEncryption=true;
bootPassword=cLo4u922sc23aPe
-- configure an existing unencrypted database for encryption
jdbc:derby:salesdb;dataEncryption=true;bootPassword=cLo4u922sc23aPe