TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rahul Verma
NA
23
4.7k
fetching data from database using jstl and html
Jun 29 2016 4:28 AM
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.
<FORM ACTION="viewTimeTable.jsp" METHOD="POST">
<BR>
<INPUT TYPE="TEXT" NAME="id">
<BR>
<INPUT TYPE="SUBMIT" value="Submit">
</FORM>
<%
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 {
%>
<TABLE BORDER="1">
<TR>
<th>Time_table_id</th>
<th>Time_table_class_id</th>
<th>day</th>
<th>lecture</th>
<th>time_table_subject_id </th>
<th>Time_table_teacher_id</th>
<th>class_councillor1 </th>
<th>class_councillor2 </th>
<th>status </th>
</TR>
<TR>
<TD> <%= resultset.getInt(1) %> </TD>
<TD> <%= resultset.getString(2) %> </TD>
<TD> <%= resultset.getString(3) %> </TD>
<TD> <%= resultset.getString(4) %> </TD>
<TD> <%= resultset.getString(5) %> </TD>
<TD> <%= resultset.getString(6) %> </TD>
<TD> <%= resultset.getString(7) %> </TD>
<TD> <%= resultset.getString(8) %> </TD>
<TD> <%= resultset.getString(9) %> </TD>
</TR>
</TABLE>
<BR>
<%
}
%>
Reply
Answers (
1
)
JSTL(java) or java
I want to compare 2 CSV files using JAVA