title: How to fetch entries/values from database to a jsp page one by one?
body: <p>I have a table in Microsoft SQL server Management Studio with two columns title and data and each column has 10 enteries.
  I have a jsp page on which i want to display different database entries of the column title in different blocks. 
  Now what code i should write that i get each entry in each block?
  On my jsp page i wrote:</p>
  
  <pre><code>&lt;%  
  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  Connection cn = DriverManager.getConnection("jdbc:odbc:ablogs", "sa", "pretty");
  Statement stmt = cn.createStatement();
  ResultSet rs = stmt.executeQuery("select title from Postdata"); %&gt;
   &lt;table&gt;
  &lt;tbody&gt;
   &lt;% while (rs.next()) {%&gt;
  &lt;tr&gt;
  &lt;td&gt;
  &lt;%=rs.getString(1)%&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;%}%&gt;
  &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>through this code i get all entries at one time but i want to get values one by one in diffrent blocks.</p>