1 43 package net.jforum.dao.sqlserver; 44 45 import java.sql.PreparedStatement ; 46 import java.util.ArrayList ; 47 import java.util.List ; 48 49 import net.jforum.JForumExecutionContext; 50 import net.jforum.util.preferences.SystemGlobals; 51 52 56 public class SqlServerTopicDAO extends net.jforum.dao.generic.GenericTopicDAO 57 { 58 61 public List selectAllByForumByLimit(int forumId, int startFrom, int count) throws Exception 62 { 63 List l = new ArrayList (); 64 65 String top = SystemGlobals.getSql("GenericModel.selectByLimit"); 66 67 PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement((top + " " + count + " " + SystemGlobals.getSql("TopicModel.selectAllByForumByLimit1") + " " + top + " " + startFrom + " " + SystemGlobals.getSql("TopicModel.selectAllByForumByLimit2"))); 68 p.setInt(1, forumId); 69 p.setInt(2, forumId); 70 71 return super.fillTopicsData(p); 72 } 73 74 77 public List selectRecentTopics (int limit) throws Exception 78 { 79 List l = new ArrayList (); 80 81 PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GenericModel.selectByLimit") + " " + limit + " " + SystemGlobals.getSql("TopicModel.selectRecentTopicsByLimit")); 82 83 return this.fillTopicsData(p); 84 } 85 } 86 | Popular Tags |