derby.connection.requireAuthentication=true derby.authentication.provider=BUILTIN derby.user.judy=no12see
The following example connects to the default server name localhost on the default port, 1527, and to the database adminample.
jdbc:derby://localhost:1527/sample;user=judy;password=no12see
jdbc:derby://localhost:1527/sample;create=true;user=judy; password=no12see
This example connects to the default server name localhost on the default port, 1527, and includes the path in the database name portion of the URL.
jdbc:derby://localhost:1527/c:/my-db-dir/my-db-name;user=judy; password=no12see
The following example shows how to use the network client driver to connect the network client to the Network Server:
String databaseURL = "jdbc:derby://localhost:1527/sample"; // // Load Derby Network Client driver class // If you are running on JDK 1.6 or higher, then you do not // need to invoke Class.forName(). In that environment, the // network client driver loads automatically. // Class.forName("org.apache.derby.jdbc.ClientDriver"); // Set user and password properties Properties properties = new Properties(); properties.put("user", "judy"); properties.put("password", "no12see"); // Get a connection Connection conn = DriverManager.getConnection(databaseURL, properties);