How to Fetch Records From Database Using JSTL in JSP page of Java

<%
try{
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/atten?" + "user=root&password=xxxx");
Statement statement = connection.createStatement() ;
resultset =statement.executeQuery("select distinct time_table_class_id from time_table_details" ) ;
%>

Drop down box or select element

<%
}
catch(Exception e)
{
out.println("wrong entry"+e);
}
%>
In this code drop down created but I want to when select a list from drop down, and clicking on click button all the data regarding fetch from database? Everything happen on same page.