开始使用免费开始使用

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.

本练习是课程的一部分

Querying a PostgreSQL Database in Java

查看课程

练习说明

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

交互式实操练习

通过完成这段示例代码来试试这个练习。

public class Main {
    public static void main(String[] args) {
        // Build the JDBC connection URL
        String url = "____:____://localhost:5432/library_db";
        System.out.println(url);
    }
}
编辑并运行代码