You connect to a database using a form of the Derby connection URL as an argument to the DriverManager.getConnection call (see Derby JDBC database connection URL). You specify a path to the database within this connection URL.