File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Building HTML Controls On The Fly

 
Mike London
Ranch Hand
Posts: 1158
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to create some HTML TEXT controls in a loop that will display the contents of a result set.
Below is what I came up with. This displays an empty TEXT field, but no data. I checked and the rs.getString(item) is returning some string data.
Can anybody tell me what change I need to make to the text below so it'll print out the rs.getString(item)>?
Thanks much.
-----------------------
out.println("<p><INPUT TYPE=TEXT, NAME= " + namVar + "VALUE= " + rs.getString(item)+"<p>");
(???)
 
George Larry
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:

ITEM should be the name of the column in the db. (SELECT ITEM FROM TABLE), alternatively you can do this rs.getString( 1 ) which will return the 1st column your query returns.
 
Mike London
Ranch Hand
Posts: 1158
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, this worked after I uncommented "ITEM".
Thank you very much!!!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic