LDAPResultSet List getResultSetNames()
Brought to you by:
pavelsavin
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<String> names = new ArrayList<String>\(\); 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;
}