• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying the result set

 
Mary Wallace
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having difficulty in dispalying the result frm db.
this is my query which is working fine and in the page when i use <%=s%> this I am getting error. Is something wrong what i am doing

<%=s%> giving me an error. How should i display s . System.out.println printed s correctly/
Thanks in advance
 
Tim Baker
Ranch Hand
Posts: 541
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well it depends where you are trying to use s. because s is declared in that while loop, you can only use s in that while loop, because it takes on many values you would only want to anyway. so lets see the actual bit where you use s.
if you are going to use it within the while loop it is much easier to do:
out.println(s);
rather than
%> <%=s %> <%
which may be what you were doing?
you probably also want to put some HTML either side of s so it's probably more like
out.println("<blah>" + s + "</blah>");
etc etc
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the open source FormattedDataSet API for an easy way generating this type of dynamic text. A live demo is available at http://www.fdsapi.com that allows you to enter any query and return it as an html table. The html table also has clickable/sortable column headers. The direct link to the sort demo is http://www.ssouza.com/fdsapi/sortdemo.jsp
steve - http://www.fdsapi.com - The easiest way to generate dynamic text including HTML and XML.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic