The JSP Standard Tags Library, also known as JSTL, allows us to connect a database and perform queries. The complexity is hided behind the available JSTL SQL tags. The following short video clip shows that capability.
More training material about JSTL can be found in the community free (for personal and academic usage) course I have recently developed at www.abelski.com. You can find the equivalent commercial professional course at www.xperato.com.