0

Please help me out where i am unable to show the below "out.println" data in table format.

if(rs.next())          
 {         
out.println(rs.getString("Case_Title"));         
out.println(rs.getString("Problem_Descr"));          
out.println(rs.getString("Problem_Submit"));         
}         
}        
catch(Exception e)        
{         
e.printStackTrace();        
}        

3 Answers3

0

Check this link http://www.coderanch.com/t/493812/JSP/java/display-records-Grid-view-format

All you need to do is use jsp scriptlet <% .....%>

Ashish
  • 67
  • 1
  • 2
  • 6
0

Try like this

<%
    while (rs.next()) {
%>
<p ><%=rs.getString("Case_Title")%></p>
<p ><%=rs.getString("Problem_Descr")%></p>
<p ><%=rs.getString("Problem_Submit")%></p>

<%
    }
%>

and avoid scriplets,if possible

Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
0

Use below code::

<table>
    if(rs.next())          
    {         
        out.println("<tr>");
        out.println("<td>");
        out.println(rs.getString("Case_Title"));         
        out.println("</td>");
        out.println("<td>");
        out.println(rs.getString("Problem_Descr"));          
        out.println("</td>");
        out.println("<td>");
        out.println(rs.getString("Problem_Submit"));         
        out.println("</td>");
        out.println("</tr>");
    }         
    }        
    catch(Exception e)        
    {         
        e.printStackTrace();        
    } 
<table>
Tushar Trivedi
  • 400
  • 1
  • 2
  • 12