日期:2014-05-18  浏览次数:20643 次

这句为什么不循环?在线急======
int   xiaozuid[]=null;
int   x=0;

while(rs1.next())
{
      pw.print( "         <td   colspan=\ "10\ "> <div   align=\ "center\ "   class=\ "STYLE1\ "> "+rs1.getString(1)+ " </div> </td> ");
      xiaozuid[x]   =   rs1.getInt(2);
      x++;
}
数据库里有3行纪录。取的时候也能正常取出来。但是      
xiaozuid[x]=rs1.getInt(2);
      x++;
这句却不能循环。。。郁闷中

------解决方案--------------------
你的xiaozuid[]=null; 还没初始化怎么赋值啊?
------解决方案--------------------
不能确定长度的就不要用数组了吧,你可以用ArrayList。
------解决方案--------------------
up
------解决方案--------------------
int xiaozuid[]= new Array[rs1.getRow()];