I'm using jstl with html in this code if hard-coded in input field, when click on submit button not display the data from database in my project. But while creating one more jsp page and paste these code into jsp and when run jsp page it shows the data regarding hard coded. But it not working in my project when combining.
<%
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/attendance?" + "user=root&password=abhi");
Statement statement = connection.createStatement();
String id = request.getParameter("id");
ResultSet resultset = statement.executeQuery("select * from time_table_details where time_table_class_id = '" + id + "'") ;
if(!resultset.next()) {
} else {
%>
| Time_table_id | Time_table_class_id | day | lecture | time_table_subject_id | Time_table_teacher_id | class_councillor1 | class_councillor2 | status |
|---|---|---|---|---|---|---|---|---|
| <%= resultset.getInt(1) %> | <%= resultset.getString(2) %> | <%= resultset.getString(3) %> | <%= resultset.getString(4) %> | <%= resultset.getString(5) %> | <%= resultset.getString(6) %> | <%= resultset.getString(7) %> | <%= resultset.getString(8) %> | <%= resultset.getString(9) %> |
<%
}
%>
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsForums
Top experts
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Nitin SontakkeRank #264 · 9.6K reputationPosted Jun 29, 2016, 12:35 AM EDT