1 40 package com.mvnforum.db.portal; 41 42 import java.sql.*; 43 import java.sql.Date ; 44 import java.util.Collection ; 45 46 import org.apache.commons.logging.Log; 47 import org.apache.commons.logging.LogFactory; 48 import com.mvnforum.db.*; 49 import net.myvietnam.mvncore.db.DBUtils; 50 import net.myvietnam.mvncore.exception.*; 51 52 public class MemberDAOImplBaseOnPortal implements MemberDAO { 53 54 private static Log log = LogFactory.getLog(MemberDAOImplBaseOnPortal.class); 55 56 58 public void create(String memberName, String memberPassword, String memberFirstEmail, String memberEmail, int memberEmailVisible, int memberNameVisible, String memberFirstIP, String memberLastIP, int memberViewCount, int memberPostCount, Timestamp memberCreationDate, Timestamp memberModifiedDate, Timestamp memberExpireDate, Timestamp memberLastLogon, int memberOption, int memberStatus, String memberActivateCode, String memberTempPassword, int memberMessageCount, int memberMessageOption, int memberPostsPerPage, int memberWarnCount, int memberVoteCount, int memberVoteTotalStars, int memberRewardPoints, String memberTitle, double memberTimeZone, String memberSignature, String memberAvatar, String memberSkin, String memberLanguage, String memberFirstname, String memberLastname, int memberGender, Date memberBirthday, String memberAddress, String memberCity, String memberState, String memberCountry, String memberPhone, String memberMobile, String memberFax, String memberCareer, String memberHomepage, String memberYahoo, String memberAol, String memberIcq, String memberMsn, String memberCoolLink1, String memberCoolLink2) throws CreateException, DatabaseException, DuplicateKeyException { 60 72 throw new IllegalStateException (); 73 } 74 75 public final String getNameFromID(int memberID) 76 throws ObjectNotFoundException, DatabaseException { 77 78 Connection connection = null; 79 PreparedStatement statement = null; 80 ResultSet resultSet = null; 81 String sql = "SELECT MemberName FROM " + TABLE_NAME + " WHERE MemberID = ?"; 82 try { 83 connection = DBUtils.getConnection(); 84 statement = connection.prepareStatement(sql); 85 statement.setInt(1, memberID); 86 resultSet = statement.executeQuery(); 87 if(!resultSet.next()) { 88 throw new ObjectNotFoundException("Cannot find the row in table Member where MemberName = " + memberID); 89 } 90 return resultSet.getString(1); 91 } catch(SQLException sqle) { 92 log.error("Sql Execution Error!", sqle); 93 throw new DatabaseException("Error executing SQL in MemberDAOImplJDBC.getMemberIDFromMemberName."); 94 } finally { 95 DBUtils.closeResultSet(resultSet); 96 DBUtils.closeStatement(statement); 97 DBUtils.closeConnection(connection); 98 } 99 } 100 101 public void deleteByPrimaryKey(int memberID) throws DatabaseException { 102 throw new IllegalStateException (); 103 } 104 105 public void findByAlternateKey_MemberEmail(String memberEmail) throws ObjectNotFoundException, DatabaseException { 106 throw new IllegalStateException (); 107 } 108 109 public void findByAlternateKey_MemberName(String memberName) throws ObjectNotFoundException, DatabaseException { 111 DAOFactory.getLocalMemberDAO().findByAlternateKey_MemberName(memberName); 113 } 114 115 public void findByPrimaryKey(int memberID) throws ObjectNotFoundException, DatabaseException { 117 DAOFactory.getLocalMemberDAO().findByPrimaryKey(memberID); 119 } 120 121 public void findByPrimaryKey2(int memberID, String memberName) throws ObjectNotFoundException, DatabaseException { 123 DAOFactory.getLocalMemberDAO().findByPrimaryKey2(memberID, memberName); 125 } 126 127 public String getActivateCode(int memberID) throws ObjectNotFoundException, DatabaseException { 128 throw new IllegalStateException (); 129 } 130 131 public Collection getAuthorizedMembers() throws DatabaseException { 132 throw new IllegalStateException (); 133 } 134 135 public Collection getEnableMembers_inActivationStatus(String kind) throws DatabaseException { 136 throw new IllegalStateException (); 137 } 138 139 public Collection getEnableMembers_inGroup(int groupID) throws DatabaseException { 140 throw new IllegalStateException (); 141 } 142 143 public Collection getForumsAuthorizedMembers() throws DatabaseException { 144 throw new IllegalStateException (); 145 } 146 147 public MemberBean getMember_forEditCurrentMember(int memberID) throws ObjectNotFoundException, DatabaseException { 148 throw new IllegalStateException (); 149 } 150 151 public MemberBean getMember_forPublic(int memberID) throws ObjectNotFoundException, DatabaseException { 153 return DAOFactory.getLocalMemberDAO().getMember_forPublic(memberID); 155 157 } 158 159 public MemberBean getMember_forViewCurrentMember(int memberID) throws ObjectNotFoundException, DatabaseException { 160 return DAOFactory.getLocalMemberDAO().getMember_forViewCurrentMember(memberID); 162 164 } 165 166 public int getMemberIDFromMemberEmail(String memberEmail) throws ObjectNotFoundException, DatabaseException { 167 throw new IllegalStateException (); 168 } 169 170 public int getMemberIDFromMemberName(String memberName) throws ObjectNotFoundException, DatabaseException { 172 return DAOFactory.getLocalMemberDAO().getMemberIDFromMemberName(memberName); 174 } 175 176 public MemberBean getMemberFromMemberName(String memberName) throws ObjectNotFoundException, DatabaseException { 177 throw new IllegalStateException (); 178 } 179 180 public Collection getMembers_inExpire_limit(Timestamp expireDate, int offset, int rowsToReturn, String sort, String order) throws IllegalArgumentException , DatabaseException { 181 throw new IllegalStateException (); 182 183 } 184 185 public Collection getMembers_withSortSupport_limit(int offset, int rowsToReturn, String sort, String order) throws IllegalArgumentException , DatabaseException { 186 throw new IllegalStateException (); 187 } 188 189 public Collection getMembers() throws DatabaseException { 190 throw new IllegalStateException (); 191 } 192 193 public Collection getNonActivatedNoPostMembers(Timestamp before) throws DatabaseException { 194 throw new IllegalStateException (); 195 } 196 197 public int getNumberOfMembers_inActivationStatus(boolean activationStatus) throws AssertionException, DatabaseException { 198 throw new IllegalStateException (); 199 } 200 201 public int getNumberOfMembers_inExpire(Timestamp expireDate) throws AssertionException, DatabaseException { 202 throw new IllegalStateException (); 203 } 204 205 public int getNumberOfMembers_inMemberStatus(int memberStatus) throws AssertionException, DatabaseException { 206 throw new IllegalStateException (); 207 } 208 209 public int getNumberOfMembers() throws AssertionException, DatabaseException { 211 return DAOFactory.getLocalMemberDAO().getNumberOfMembers(); 213 } 214 215 public String getPassword(int memberID) throws ObjectNotFoundException, DatabaseException { 216 throw new IllegalStateException (); 217 } 218 219 public String getTempPassword(int memberID) throws ObjectNotFoundException, DatabaseException { 220 throw new IllegalStateException (); 221 } 222 223 public void increasePostCount(int memberID) throws DatabaseException, ObjectNotFoundException { 225 DAOFactory.getLocalMemberDAO().increasePostCount(memberID); 227 } 228 229 public void increaseViewCount(int memberID) throws DatabaseException, ObjectNotFoundException { 231 DAOFactory.getLocalMemberDAO().increasePostCount(memberID); 233 } 234 235 public void update(int memberID, int memberEmailVisible, int memberNameVisible, Timestamp memberModifiedDate, int memberOption, int memberStatus, int memberMessageOption, int memberPostsPerPage, double memberTimeZone, String memberSkin, String memberLanguage, String memberFirstname, String memberLastname, int memberGender, Date memberBirthday, String memberAddress, String memberCity, String memberState, String memberCountry, String memberPhone, String memberMobile, String memberFax, String memberCareer, String memberHomepage, String memberYahoo, String memberAol, String memberIcq, String memberMsn, String memberCoolLink1, String memberCoolLink2) throws ObjectNotFoundException, DatabaseException { 236 throw new IllegalStateException (); 237 } 238 239 public void updateActivateCode(int memberID, String memberActivateCode) throws ObjectNotFoundException, DatabaseException { 240 throw new IllegalStateException (); 241 } 242 243 public void updateAvatar(int memberID, String memberAvatar) throws ObjectNotFoundException, DatabaseException { 244 throw new IllegalStateException (); 245 } 246 247 public void updateEmail(int memberID, String memberEmail) throws ObjectNotFoundException, DatabaseException, DuplicateKeyException { 248 throw new IllegalStateException (); 249 } 250 251 public void updateLastLogon(int memberID, Timestamp memberLastLogon, String lastIP) throws ObjectNotFoundException, DatabaseException { 252 throw new IllegalStateException (); 253 } 254 255 public void updateMember_expireDate(int memberID, Timestamp expireDate) throws ObjectNotFoundException, DatabaseException { 256 throw new IllegalStateException (); 257 } 258 259 public void updatePassword(int memberID, String memberPassword) throws ObjectNotFoundException, DatabaseException { 260 throw new IllegalStateException (); 261 } 262 263 public void updatePostCount(int memberID, int memberPostCount) throws ObjectNotFoundException, DatabaseException { 264 throw new IllegalStateException (); 265 } 266 267 public void updateSignature(int memberID, String memberSignature) throws ObjectNotFoundException, DatabaseException { 268 throw new IllegalStateException (); 269 } 270 271 public void updateStatus(int memberID, int memberStatus) throws ObjectNotFoundException, DatabaseException { 272 throw new IllegalStateException (); 273 } 274 275 public void updateTempPassword(int memberID, String memberTempPassword) throws ObjectNotFoundException, DatabaseException { 276 throw new IllegalStateException (); 277 } 278 279 public void updateTitle(int memberID, String memberTitle) throws ObjectNotFoundException, DatabaseException { 280 throw new IllegalStateException (); 281 } 282 } 283 | Popular Tags |