title: Create radio buttons and check the one that has a value fetched from database
body: <p>I have a database from which I query the value of <code>gender</code> attribute. Based on that value I want to insert into a <code>jsp</code> webpage multiple radio buttons so that only the one that represents the fetched value is checked and the rest will remain unchecked.</p>
  <pre><code>&lt;%
      while(rs.next())
      {
          String gender = &quot;&quot;;
          gender = rs.getString(&quot;gender&quot;);
  
          if(gender.equalsIgnoreCase(&quot;Male&quot;))
          {
              // What do I put here?
          }
          else
          {
              // What do I put here?
          }
      }
  %&gt;
  </code></pre>
  <p>I would also like to use <code>labels</code> with my radio buttons so that the final result would represent something similar to this:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;label class=&quot;radio-inline&quot;&gt;
      &lt;input type=&quot;radio&quot; id=&quot;gender&quot; name=&quot;gender&quot; value=&quot;Male&quot;&gt;
      Male
  &lt;/label&gt;
  </code></pre>