use of net.jforum.util.GroupNode in project jforum2 by rafaelsteil.
the class GenericTreeGroupDAO method selectGroups.
/**
* @see net.jforum.dao.TreeGroupDAO#selectGroups(int)
*/
public List selectGroups(int parentId) {
List list = new ArrayList();
PreparedStatement p = null;
ResultSet rs = null;
try {
p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TreeGroup.selectGroup"));
p.setInt(1, parentId);
rs = p.executeQuery();
while (rs.next()) {
GroupNode n = new GroupNode();
n.setName(rs.getString("group_name"));
n.setId(rs.getInt("group_id"));
list.add(n);
}
return list;
} catch (SQLException e) {
throw new DatabaseException(e);
} finally {
DbUtils.close(rs, p);
}
}
Aggregations