1 17 18 package org.apache.james.userrepository; 19 20 import org.apache.james.services.User; 21 22 import java.sql.PreparedStatement ; 23 import java.sql.ResultSet ; 24 import java.sql.SQLException ; 25 26 32 public class ListUsersJdbcRepository extends AbstractJdbcUsersRepository 33 { 34 42 protected User readUserFromResultSet(ResultSet rsUsers) throws SQLException { 43 String username = rsUsers.getString(1); 45 DefaultUser user = new DefaultUser(username, "SHA"); 46 return user; 47 } 48 49 58 protected void setUserForInsertStatement(User user, 59 PreparedStatement userInsert) 60 throws SQLException { 61 userInsert.setString(1, user.getUserName()); 62 } 63 64 74 protected void setUserForUpdateStatement(User user, 75 PreparedStatement userUpdate) 76 throws SQLException { 77 throw new UnsupportedOperationException ("Can't update a List User - " + 78 "only has a single attribute."); 79 } 80 } 81 | Popular Tags |