I am trying to show values from mysql table to a jsp table via servlet and I have done following in BookSaleAuctionServlet
con = DriverManager.getConnection("jdbc:mysql://localhost/logins", "root", "");
try {
ArrayList<String> arr = new ArrayList<String>();
Statement stmt = con.createStatement();
ResultSet rst = stmt.executeQuery
("SELECT m.id,m.username,m.address,m.email,m.contact FROM members m");
request.setAttribute("memberList", rst);
request.getRequestDispatcher("MemberDetail.jsp").forward(request, response);
and in MemberDetail.jsp
<p>---------${memberList}</p>
<table border="1">
<thead>
<tr>
<th>Name</th>
<th>Address</th>
<th>Contact</th>
<th>Email</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<c:forEach var="row" items="${memberList}">
<tr>
<td><c:out value="${row.id}"/> </td>
<td><c:out value="${row}"></c:out> </td>
<td><c:out value="${row[0]}"></c:out> </td>
<td></td>
<td><a href="MemberDetailUpdate.jsp" name="Edit">Edit</a> </td>
</tr>
</c:forEach>
</tbody>
</table>
Now i am not able to get values in the table and the value arriving from ${memberList}
is com.mysql.jdbc.JDBC4ResultSet@166d6d3
I dont know how can i fetch value please help