In your Java program, you can open a database connection like this:
String url = "jdbc:postgresql:COREJAVA"; String username = "dbuser"; String password = "secret"; Connection conn = DriverManager.getConnection(url, username, password);
The driver manager iterates through the registered drivers to find a driver that can use the subprotocol specified in the database URL.
getConnection method returns a
Connection object. In the following sections, you will see how to use the
Connection object to execute SQL statements.
To connect to the database, you will need to have a user name and password for your database.
By default, Derby lets you connect with any user name, and it ...