- Java code
......if (rs.next()){ String logname = rs.getString("logname"); String sex = rs.getString("sex"); String age = rs.getString("age"); String email =rs.getString("email"); out.println("<tr>"); out.println("<td align=center>"+logname+"</td>"); out.println("<td align=center>"+sex+"</td>"); out.println("<td align=center>"+age+"</td>"); out.println("<td align=center>"+email+"</td>"); out.println("<td align=\"center\">添加好友</td>"); out.println("</tr>");} ......
数据库有多条记录,但是出来的总是一条
------解决方案--------------------
if (rs.next())
改为
while
------解决方案--------------------
把if 改成while