1. 学习
  2. /
  3. 课程
  4. /
  5. Querying a PostgreSQL Database in Java

Connected

练习

Data in a ResultSet

Now that CityBook Libraries can execute queries, you need to extract the actual data from the ResultSet. A ResultSet works like a cursor that moves row by row, and you retrieve column values using getter methods.

Extract the title and publication_year from each book in the results. All necessary imports are available for you.

说明

100 XP
  • Move through each row in the ResultSet.
  • Retrieve the title and publication_year columns using the appropriate getter methods.