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:
<%
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"); %>
<table>
<tbody>
<% while (rs.next()) {%>
<tr>
<td>
<%=rs.getString(1)%>
</td>
</tr>
<%}%>
</tbody>
</table>
through this code i get all entries at one time but i want to get values one by one in diffrent blocks.
Please ensure that you
code!)
Assuming you’ll change the above later (and if I have understood you correctly), you might want to do it like this: