JSP file actually similar to HTML file, however, we can use java script inside the jsp file. also, we can use coding to connect with database and retrieve data from database with database connector JDBC. I would like to explain and show here how a simple JSP page work on online and then How JSP work with database. Here is an example of Login.jsp file:
an example of Code behind the page used in JSP
to get ready for MYSQL database system to store information and retrieve information from the internet. After successfully installed and configuration MySQL. we can Run the SQL server through the MYSQL command line from MYSQL menu bar. here is an image to set up and configured datadir variable in My.ini configuration file to show where the servlet application Web files located. I did not configured any password so I just Enter without given any password and showing where web application folder located.