roleStatement = connection.prepareStatement(roleQuery);
roleStatement.setString(1, user);
roleResultSet = roleStatement.executeQuery();
while (roleResultSet.next()) {
String role = roleResultSet.getString(1);
principals.add(new RolePrincipal(role));
}
} catch (Exception ex) {
throw new LoginException("Error has occured while retrieving credentials from database:" + ex.getMessage());
} finally {
try {