For example, to set the user name and password:
Properties p = new Properties();
p.setProperty("user", "sa");
p.setProperty("password", "manager");
p.setProperty("create", "true");
Connection conn = DriverManager.getConnection(
"jdbc:derby:mynewDB", p);
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.