sql= "select top 3 * from info order by id DESC ";
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()){
id=rs.getString( "id ").trim();
name=rs.getString( "name ").trim();
i++;
}
现在怎么把3个name数据读到下面3个
String a=
String b=
String c=
------解决方案--------------------
循环的时候先放到一个数组中,
------解决方案--------------------
别用 while
rs.next()
String a=rs.getString( "name ").trim();
rs.next()
String b=rs.getString( "name ").trim();
rs.next()
String c=rs.getString( "name ").trim();