Get startedGet started for free

Connection URL

You're building a digital library management system for CityBook Libraries. Their book catalog is stored in a PostgreSQL database called library_db, which is running on localhost:5432. Before your Java application can query book data, it needs the correct JDBC connection URL.

Create the connection URL to connect to the database.

This exercise is part of the course

Querying a PostgreSQL Database in Java

View Course

Exercise instructions

  • Replace the placeholders in the URL with the correct JDBC scheme and PostgreSQL database type.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

public class Main {
    public static void main(String[] args) {
        // Build the JDBC connection URL
        String url = "____:____://localhost:5432/library_db";
        System.out.println(url);
    }
}
Edit and Run Code