out.println("<table border=1>")
out.println("<tr><td>" + "序号" + "</td><td>" + "账号" + "</td><td>"+ "密码" + "</td></tr>")
String sql = "select * from users "
ResultSet rs = null
rs = db.executeQuery(sql)
while (rs.next()) {
String id = rs.getString(1)
String nam = rs.getString(2)
String pas = rs.getString(3)
out.println("<tr><td>" + id + "</td><td>" + nam + "</td><td>" + pas+ "</td></tr>")
}
out.println("</table >")
说的能不能具体点啊!rs.getInt("ID")
如果是获得表单提交的ID就用
request.getParameter("ID")
注:这里的ID是表单元素的名字!如<input type=text name="ID"/>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)