# Precedence of properties

The search order for properties is as follows.

1. System-wide properties set programmatically (as a command-line option to the JVM when starting the application or within application code)
2. Database-wide properties
3. System-wide properties set in the derby.properties file

This means, for example, that system-wide properties set programmatically override database-wide properties and system-wide properties set in the derby.properties file, and that database-wide properties override system-wide properties set in the derby.properties file.

- Protection of database-wide properties
  There is one important exception to the search order for properties described above: When you set the derby.database.propertiesOnly property to true, database-wide properties cannot be overridden by system-wide properties.

Parent topic: Properties overview
Related concepts
Scope of properties
Persistence of properties
Dynamic versus static properties