Menu

#2 LDAPResultSet getList(String attrName)

open
nobody
None
5
2008-02-27
2008-02-27
trames
No

Add this method to retrieve by name instead of number:

// getList by attribute name
public List getList(String attrName) throws DAOException {
try {
ArrayList list = new ArrayList();
Attribute attr = attrs.get(attrName);

if(attr != null){
NamingEnumeration en = attr.getAll();
while(en.hasMore()) {
String val = (String) en.next();
list.add(val);
}
}
return list;
}
catch(NamingException ex) {
throw new DAOException(ex);
}
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.