I want to send multiple values from a table from a database from hashmap in java tp a jsp file.this is what i have done so far
ResultSet rs = st.executeQuery("SELECT * FROM seeding where scheme = '"+user+"' ");
HashMap<String, String> verify = new HashMap<String, String>();
while (rs.next())
{
verify.put("beneficiaryID",rs.getString("beneficiaryID"));
verify.put("scheme", rs.getString("scheme"));
verify.put("aadhaar",rs.getString("aadhaar"));
verify.put("name",rs.getString("name"));
}
request.setAttribute("verify", verify);
jsp >>
<%
HashMap<String, String> verify = (HashMap<String, String>)
request.getAttribute("verify");
for (String key : verify.keySet())
{
out.print(verify.get("aadhaar"));
out.print(verify.get("scheme"));
out.print(verify.get("beneficiaryID")+"$"+verify.get("name"));
}
But this only gives the last Row of the table not all the results !! What needs to be changed ? thanks