# Setting attributes for the database connection URL

Derby allows you to supply a list of attributes to its database connection URL, which is a JDBC feature.

The attributes are specific to Derby.

You typically set attributes in a semicolon-separated list following the protocol and subprotocol (and, in some cases, the subsubprotocol). For information on how you set attributes, see Attributes of the Derby database connection URL. This section provides reference information only.

The DriverManager.getConnection method can take both a connection URL and a Properties object as arguments. If you specify any attributes both on the connection URL and in a Properties object, the attributes on the connection URL override the attributes in the Properties object.

Note: Attributes are not parsed for correctness. If you pass in an incorrect attribute or corresponding value, it is simply ignored.

- bootPassword=key attribute
  The bootPassword=key attribute specifies a boot password (encryption key).
- collation=collation attribute
  The collation=collation attribute is an optional attribute that specifies whether collation is based on the locale specified for the database or on Unicode codepoint collation.
- create=true attribute
  The create=true attribute creates the standard database specified within the database connection URL Derby system and then connects to it.
- createFrom=path attribute
  The createFrom=path attribute creates a database using a full backup at a specified location.
- databaseName=nameOfDatabase attribute
  The databaseName=nameOfDatabase attribute specifies a database path name for a connection.
- dataEncryption=true attribute
  The dataEncryption=true attribute specifies data encryption on disk for a new database or to configure an existing unencrypted database for encryption.
- decryptDatabase=true attribute
  The decryptDatabase=true attribute returns an encrypted database to an unencrypted state.
- deregister=false attribute
  The deregister=false attribute, 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.
- drop=true attribute
  The drop=true attribute removes the in-memory database specified within the database connection URL.
- encryptionKey=key attribute
  The encryptionKey=key attribute specifies an external encryption key.
- encryptionKeyLength=length attribute
  The encryptionKeyLength=length attribute specifies the number of bits in the encryption key to be generated when a database is encrypted with the bootPassword=key attribute.
- encryptionProvider=providerName attribute
  The encryptionProvider=providerName attribute specifies the provider for data encryption.
- encryptionAlgorithm=algorithm attribute
  The encryptionAlgorithm=algorithm attribute specifies the algorithm for data encryption.
- failover=true attribute
  The failover=true attribute stops database replication on the slave system and converts the slave database into a normal database.
- logDevice=logDirectoryPath attribute
  The logDevice=logDirectoryPath attribute specifies the path to the directory on which to store the database log during database creation or restoration.
- newBootPassword=newPassword attribute
  The newBootPassword=newPassword attribute specifies a new boot password for an encrypted database.
- newEncryptionKey=key attribute
  The newEncryptionKey=key attribute specifies a new external encryption key for an encrypted database.
- password=userPassword attribute
  The password=userPassword attribute specifies a valid password for the given user name.
- restoreFrom=path attribute
  The restoreFrom=path attribute restores a database using a full backup from the specified location.
- retrieveMessageText=false attribute
  The retrieveMessageText=false attribute, if set to true (the default), retrieves the message text for each SQLException from the server.
- rollForwardRecoveryFrom=path attribute
  The rollForwardRecoveryFrom=path attribute restores a database using a backup copy and performs roll-forward recovery using archived and active logs.
- securityMechanism=value attribute
  The securityMechanism=value attribute specifies a security mechanism for client access to the Network Server.
- shutdown=true attribute
  The shutdown=true attribute shuts down the specified database if you specify a databaseName. (Reconnecting to the database reboots the database.)
- slaveHost=hostname attribute
  The slaveHost=hostname attribute specifies the system that will serve as the slave for database replication.
- slavePort=portValue attribute
  The slavePort=portValue attribute specifies the port that the slave system will use in database replication.
- ssl=sslMode attribute
  The ssl=sslMode attribute specifies the SSL mode of the client.
- startMaster=true attribute
  The startMaster=true attribute starts replication of a database in master mode.
- startSlave=true attribute
  The startSlave=true attribute starts replication of a database in slave mode.
- stopMaster=true attribute
  The stopMaster=true attribute stops database replication on the master system.
- stopSlave=true attribute
  The stopSlave=true attribute stops database replication on the slave system.
- territory=ll_CC attribute
  The territory=ll_CC attribute associates a non-default locale with a database at database creation time.
- traceDirectory=path attribute
  The traceDirectory=path attribute specifies a directory to which the Derby Network Client will send JDBC trace information.
- traceFile=path attribute
  The traceFile=path attribute specifies a file to which the Derby Network Client will send JDBC trace information.
- traceFileAppend=true attribute
  The traceFileAppend=true attribute specifies that the Derby Network Client should append JDBC trace information to a trace file.
- traceLevel=value attribute
  If tracing is enabled, the traceLevel=value attribute specifies the level of tracing to be used by the Derby Network Client.
- upgrade=true attribute
  The upgrade=true attribute upgrades a database that was created using an earlier version of Derby to the current version of Derby, then connects to it.
- user=userName attribute
  The user=userName attribute specifies a valid user name for the system, in conjunction with a password.
- Creating a connection without specifying attributes
  If no attributes are specified, you must specify a databaseName.