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
JSTL(java) or java
Jun 28 2016 7:22 AM
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" ) ;
%>
<center>
<h1> Drop down box or select element</h1>
<select id="semester" onchange="loadSemester();">
<% while(resultset.next()){ %>
<option value="<%= resultset.getString(1)%>"><%= resultset.getString(1)%></option><br>
<% } %>
</select>
<input type="submit" name="Submit" value="click">
</center>
<%
}
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.
Reply
Answers (
0
)
Job For Fresher In Java Or Android
fetching data from database using jstl and html