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
<% while(resultset.next()){ %>
<% } %>
<%
}
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.
Answers
Know the answer? Post it. Somebody with the same question will find it here.