Why does rs.next() return only one result?
<p>I wrote codes like this.
In the table (SocialLevelPerUser), there are two rows satifying the "WHERE-clause". However, the "while-statement" is run only one time. 
I don't understand why this happens. I am using PostgreSQL database. 
Any thoughts / comments appreciated. Thanks.  </p>

<pre><code>ArrayList&lt;Friend&gt; getFriendList(String userId){

    ArrayList&lt;Friend&gt; friendList = new ArrayList&lt;Friend&gt;();
    Friend eachFriend = new Friend();
    try {
        st = connection.createStatement();
        rs = st.executeQuery("SELECT \"SourceName\", \"DestinationName\", \"Portion\" "
                            + "FROM public.\"SocialLevelPerUser\" "
                            + "WHERE \"SourceName\" = '" + userId + "'");

        while(rs.next()){
            eachFriend = new Friend();

            String friendId = rs.getString("DestinationName");
            double followingPortion = Double.parseDouble(rs.getString("Portion"));

            eachFriend.setUserId(friendId);
            eachFriend.setFollowingPortion(followingPortion);

            boolean isComplete = isCompleteUserId(friendId);
            boolean isFollow = isFollower(friendId, userId);
            double followerPortion = getFollowerPortion(friendId, userId);

            eachFriend.setIsCompleteUserId(isComplete);
            eachFriend.setIsFollower(isFollow);
            eachFriend.setFollowerPortion(followerPortion);

            friendList.add(eachFriend);
        }
    } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    return friendList;
}
</code></pre>

<p>I tried to input query on the client of PostgreSQL resulting in like below figure.</p>

<p><a href="https://i.stack.imgur.com/VfA0P.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VfA0P.jpg" alt="enter image description here"></a></p>