private PortalUser getPortalUser(final String userName) {
        return jdbcOperations.execute(
                (ConnectionCallback<PortalUser>)
                        con -> {
                            PortalUser portalUser = null;
                            PreparedStatement pstmt = null;

                            try {
                                String query = "SELECT USER_ID FROM UP_USER WHERE USER_NAME=?";

                                pstmt = con.prepareStatement(query);
                                pstmt.setString(1, userName);

                                ResultSet rs = null;
                                try {
                                    if (log.isDebugEnabled())
                                        log.debug(
                                                "RDBMUserIdentityStore::getPortalUID(userName="
                                                        + userName
                                                        + "): "
                                                        + query);
                                    rs = pstmt.executeQuery();
                                    if (rs.next()) {
                                        portalUser = new PortalUser();
                                        portalUser.setUserId(rs.getInt("USER_ID"));
                                        portalUser.setUserName(userName);
                                    }
                                } finally {
                                    try {
                                        if (rs != null) {
                                            rs.close();
                                        }
                                    } catch (Exception e) {
                                    }
                                }
                            } finally {
                                try {
                                    if (pstmt != null) {
                                        pstmt.close();
                                    }
                                } catch (Exception e) {
                                }
                            }

                            return portalUser;
                        });
    }
private PortalUser getPortalUser ( final String userName ) { return jdbcOperations . execute ( ( ConnectionCallback < PortalUser > ) con -> { PortalUser portalUser = null ; PreparedStatement pstmt = null ; try { String query = "SELECT USER_ID FROM UP_USER WHERE USER_NAME=?" ; pstmt = con . prepareStatement ( query ) ; pstmt . setString ( 1 , userName ) ; ResultSet rs = null ; try { if ( log . isDebugEnabled ( ) ) log . debug ( "RDBMUserIdentityStore::getPortalUID(userName=" + userName + "): " + query ) ; rs = pstmt . executeQuery ( ) ; if ( rs . next ( ) ) { portalUser = new PortalUser ( ) ; portalUser . setUserId ( rs . getInt ( "USER_ID" ) ) ; portalUser . setUserName ( userName ) ; } } finally { try { if ( rs != null ) { rs . close ( ) ; } } catch ( Exception e ) { } } } finally { try { if ( pstmt != null ) { pstmt . close ( ) ; } } catch ( Exception e ) { } } return portalUser ; } ) ; }
Gets the PortalUser data store object for the specified user name.

@param userName The user's name
@return A PortalUser object or null if the user doesn't exist.