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 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Nitin SontakkePosted Jun 29, 2016, 4:35 AM