use of net.jforum.entities.Ranking in project jforum2 by rafaelsteil.
the class GenericRankingDAO method selectAll.
/**
* @see net.jforum.dao.RankingDAO#selectAll()
*/
public List selectAll() {
List l = new ArrayList();
PreparedStatement p = null;
ResultSet rs = null;
try {
p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.selectAll"));
rs = p.executeQuery();
while (rs.next()) {
Ranking ranking = buildRanking(rs);
l.add(ranking);
}
return l;
} catch (SQLException e) {
throw new DatabaseException(e);
} finally {
DbUtils.close(rs, p);
}
}
use of net.jforum.entities.Ranking in project jforum2 by rafaelsteil.
the class GenericRankingDAO method selectSpecials.
public List selectSpecials() {
List l = new ArrayList();
PreparedStatement p = null;
ResultSet rs = null;
try {
p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("RankingModel.selectSpecials"));
rs = p.executeQuery();
while (rs.next()) {
Ranking ranking = this.buildRanking(rs);
l.add(ranking);
}
} catch (SQLException e) {
throw new DatabaseException(e);
} finally {
DbUtils.close(rs, p);
}
return l;
}
use of net.jforum.entities.Ranking in project jforum2 by rafaelsteil.
the class RankingAction method insertSave.
// A new one
public void insertSave() {
Ranking r = new Ranking();
r.setTitle(this.request.getParameter("rank_title"));
boolean special = "1".equals(this.request.getParameter("rank_special"));
r.setSpecial(special);
if (!special) {
r.setMin(this.request.getIntParameter("rank_min"));
}
DataAccessDriver.getInstance().newRankingDAO().addNew(r);
RankingRepository.loadRanks();
this.list();
}
Aggregations