我想从 java tp 中的 hashmap 的数据库中的表中发送多个值 tp 一个 jsp 文件。这是我到目前为止所做的
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"));
}
但这只会给出表格的最后一行而不是所有结果!需要改变什么?谢谢