Keywords: Properties, setting using a Properties object, System properties, setting in a Properties object

# Using a properties object within an application or statement

In embedded mode, your application runs in the same JVM as Derby, so you can also set system properties within an application using a Properties object before loading the Derby JDBC driver. The following example sets derby.system.home on Windows.

    Properties p = System.getProperties();
    p.put("derby.system.home", "C:\databases\sample");

Note: If you pass in a Properties object as an argument to the DriverManager.getConnection call when connecting to a database, those properties are used as database connection URL attributes, not as properties of the type discussed in this book. For more information, see "java.sql.DriverManager.getConnection method" and "Setting attributes for the database connection URL" in the Java DB Reference Manual.
Parent topic: Changing the system-wide properties programmatically
Related concepts
As a parameter to the JVM command line