How to retrieve data from database and then display as a webpage in JSP
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