Search in sources :

Example 1 with ModeratorInfo

use of net.jforum.entities.ModeratorInfo in project jforum2 by rafaelsteil.

the class GenericForumDAO method getModeratorList.

/**
	 * @see net.jforum.dao.ForumDAO#getModeratorList(int)
	 */
public List getModeratorList(int forumId) {
    List l = new ArrayList();
    PreparedStatement p = null;
    ResultSet rs = null;
    try {
        p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getModeratorList"));
        p.setInt(1, forumId);
        rs = p.executeQuery();
        while (rs.next()) {
            ModeratorInfo mi = new ModeratorInfo();
            mi.setId(rs.getInt("id"));
            mi.setName(rs.getString("name"));
            l.add(mi);
        }
        return l;
    } catch (SQLException e) {
        throw new DatabaseException(e);
    } finally {
        DbUtils.close(rs, p);
    }
}
Also used : ModeratorInfo(net.jforum.entities.ModeratorInfo) SQLException(java.sql.SQLException) ArrayList(java.util.ArrayList) ResultSet(java.sql.ResultSet) ArrayList(java.util.ArrayList) List(java.util.List) PreparedStatement(java.sql.PreparedStatement) DatabaseException(net.jforum.exceptions.DatabaseException)

Aggregations

PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ModeratorInfo (net.jforum.entities.ModeratorInfo)1 DatabaseException (net.jforum.exceptions.DatabaseException)1