Welcome to the Ranch, Palak!
The first thing to realize is that JSPs are not like time-sharing terminal displays. The only way to get a JSP to update is if the client sends a new request to the server so that the server can send back a new JSP (or whatever).
You can get around that by putting an auto-refresh option in the HTML that your JSP generates. In ancient times, it was common to use a special META tag to do that. These days we often use AJAX, since that allows updating only part of a page instead of replacing the whole page on the client side.
HTTP servers likewise don't run "programs". Instead they provide services that are run when a request comes in and those services must then provide the response back to the client. So there's nothing to sit around and get updated from the database. Instead the request processor has to read from the database on each request.
In
JEE, reqest processors are
servlets. For JSPs, the JSP compiler generates a servlet by turning the JSP source into
Java code, then compiling the Java code into a class. That's all automatically done for you,