关于JSP中表单显示的问题
<%
try {
if (conn.isClosed())
return;
Statement smt = conn.createStatement();
ResultSet rs = smt.executeQuery( "select * from YPGL ");
int i = rs.getMetaData().getColumnCount();
while (rs.next()) {
%>
<tr>
<td align= "center ">
<%rs.getInt( "药品编号 "); %>
</td>
<td align= "center ">
<%rs.getString( "药品名称 "); %>
</td>
<td align= "center ">
<%rs.getString( "药品规格 "); %>
</td>
<td align= "center ">
<%rs.getString( "单位 "); %>
</td>
<td align= "center ">
<%rs.getInt( "库存数量 "); %>
</td>
<td align= "center ">
<%rs.getInt( "进价 "); %>
</td>
<td align= "center ">
<%rs.getInt( "售价 "); %>
</td>
</tr>
结果显示不出来,还望高手指点~
------解决方案--------------------那就是数据能被读出来 但是 显示不对 while(rs.next())改成if(rs。next())只显示一航数据看看
------解决方案--------------------就我看好像是少了一个 "} "这个while没有写对吧
<%}%>