Write a SQL query "SELECT * from tableName" for retrieving the data from database table and execute this query using executeQuery(sql) method of Statement interface and store the result into ResultSet. 

Syntax

<%=resultSet.getString("") %>

full article: http://www.roseindia.net/jsp/how-to-retrieve-data-from-database-in-jsp.shtml