title: jsp display random amount of rows from database
body: <p>I'm making a web-application with JSP and Servlets and I came accross this problem:
  I have a table <code>users</code> and a <code>myeducations</code> table. These table relationship is established on user_id.</p>
  
  <p>This is the table:</p>
  
  <p><strong>myeducation</strong></p>
  
  <pre>
  ----------------------------------------------------------------------------------
  | ed_id | user_id | school_name | year_attended_from | year_attended_to | degree |
  ----------------------------------------------------------------------------------
  </pre>
  
  <p>Now, I want to display on a website (jsp) all of the user educations, but the number of educations user has is random: 1 user could have finished just 1 school, other could 3 and so on...</p>
  
  <p>I understand how to retrieve just 1 row, the SQL is:</p>
  
  <pre><code>SELECT school_name 
  FROM myeducation
  INNER JOIN users ON users.user_id = myeducation.user_id;
  </code></pre>
  
  <p>But how to make this statement run in a loop, so that I get all the educations of a user, say if he has more than just 1. Then put them all in a session variable and display in a jsp's div.</p>