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.
Related concepts
As a parameter to the JVM command line