private void tree(Set articles,Connection conn,int id,int grade){
String sql="select * from article where pid="+id;
Statement stmt=DB.createStmt(conn);
ResultSet rs=DB.executQuery(stmt, sql);
try{
while(rs.next()){
Article a=new Article();
a.setId(rs.getInt("id"));
a.setPid(rs.getInt("pid"));
a.setRootid(rs.getInt("rootid"));
a.setTitle(rs.getString("title"));
a.setLeaf(rs.getInt("isleaf")==0?true:false);
a.setPdate(rs.getTime("pdate"));
a.setGrade(grade);
articles.add(a);
if(!a.isLeaf()){
tree(articles, conn, rs.getInt("id"), grade+1);
}
}