You need to know 1) how to connect to the database; 2) how to execute a SQL query; 3) how to retrieve the query result suing resultSet.next() and resultSet.getString(), etc; and 4) How to format and display the result as a table.
Source: https://www.roseindia.net/jsp/how-to-retrieve-data-from-database-in-jsp.shtml