MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » struts兑现显示数据

struts兑现显示数据(2)

www.MyException.Cn  网友分享于:2013-12-02  浏览:17次

Vector newsList = new Vector();
ResultSet rs,rsNest;
String strSql=null;

strSql = "select * from news order by time desc ";
rs = db.OpenSql(strSql);

while (rs.next()){
News news = new News();

news.setId(rs.getInt( "id ")) ;
news.setTitle(rs.getString( "title ")) ;
news.setTime(rs.getString( "time ")) ;
news.setType(rs.getInt( "type ")) ;

newsList.add(news);
}
System.out.println( "newsList: "+newsList.size());

return newsList;
}

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有