1 43 package net.jforum.dao.sqlserver; 44 45 import java.sql.PreparedStatement ; 46 import java.sql.ResultSet ; 47 import java.util.List ; 48 49 import net.jforum.JForumExecutionContext; 50 import net.jforum.util.preferences.SystemGlobals; 51 52 56 public class SqlServerUserDAO extends net.jforum.dao.generic.GenericUserDAO 57 { 58 61 public List selectAll(int startFrom, int count) throws Exception 62 { 63 PreparedStatement p; 64 65 if (count > 0) { 66 p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("GenericModel.selectByLimit") 67 + " " 68 + count 69 + " " 70 + SystemGlobals.getSql("UserModel.selectAllByLimit")); 71 p.setInt(1, startFrom); 72 p.setInt(2, count); 73 } 74 else { 75 p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.selectAll")); 76 } 77 78 ResultSet rs = p.executeQuery(); 79 List list = super.processSelectAll(rs); 80 rs.close(); 81 p.close(); 82 83 return list; 84 } 85 86 89 public List selectAllWithKarma(int startFrom, int count) throws Exception 90 { 91 return super.loadKarma( this.selectAll(startFrom, count) ); 92 } 93 94 } 95 | Popular Tags |