1. Learn
  2. /
  3. Courses
  4. /
  5. Querying a PostgreSQL Database in Java

Connected

Exercise

Book search system

CityBook Libraries' current search only supports exact book titles. They need a flexible search feature that allows visitors to search by partial title, author name, or any combination of these criteria.

You'll create a dynamic query builder that constructs SQL queries based on the search criteria provided by users. The HikariSetup class is already configured for you.

Instructions

100 XP
  • Append the title condition to the query.
  • Add AND if you added a title condition or WHERE if not, to the query.
  • Complete the query to sort by title.