Menu

#3 LDAPResultSet List getResultSetNames()

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

Add this method to retrieve a List object <String> of all the field names returned by the ResultSet. Handy if you requested all fields "SELECT *"

/**
* Returns a List of all of the field names contained
* within the result set
*
* @return
* @throws DAOException
*/
public List<String> getResultSetNames() throws DAOException {

ArrayList&lt;String&gt; names = new ArrayList&lt;String&gt;\(\);

try \{

NamingEnumeration<String> en = attrs.getIDs();
while(en.hasMore()) {
String name = (String) en.next();
names.add(name);
}
}
catch (NamingException ex) {
throw new DAOException(ex);
}

return names;

}

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.