Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Creative commons Attribution-NonCommercial license. http://creativecommons.org/licenses/by-nc/2.5/au/deed.en_GB NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
 
 package base.jee.api.sql.util;
 
Lookup the person ID associated with an LDAP username.
Lookup the person ID associated with an LDAP username.

Parameters:
c
LDAP username to lookup = * @return Returns zero, or the personId associated with this email address.
Throws:
java.sql.SQLException
	public static UUID getPersonUuidForLdapUsername(Connection cString ldapUsernamethrows SQLException {
		UUID uuid = null;
		PreparedStatement s = null;
		s = c.prepareStatement("select uuid from person where username=?");
		s.setString(1, ldapUsername);
		if(r.next()) {
			uuid = UUID.fromString(r.getString(1));
		}
		r.close();
		s.close();
		return uuid;
	}
New to GrepCode? Check out our FAQ X