aspose file tools
The moose likes Servlets and the fly likes From servlet, to Bean to JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "From servlet, to Bean to JSP" Watch "From servlet, to Bean to JSP" New topic
Author

From servlet, to Bean to JSP

Shuaib Gill
Ranch Hand

Joined: May 29, 2001
Posts: 62
Hi,
Suppose I have opened a db connection , executed and SQL query and I have 3 fields. Now suppose I want to put the values of these 3 fields into a Java Bean (not EJB). From there I want to put the values of the database query on the JSP page. How can this be done?
Thanks in advance,


programmer77
Vlad Patryshev
Ranch Hand

Joined: Jun 30, 2001
Posts: 61
You have a resultset; get the column values then. Set the bean attributes to the values you have: myBean.setAttributeNumber1(theValue). Retrieve the bean attributes and place them to the page, like this: <%= myBean.getAttributeNumber1() %>


Thanks,<br />Vlad
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: From servlet, to Bean to JSP
 
Similar Threads
retaining value in java script
Combo box building
Where to populate values for drop down box?
How to stop entering data
bundle, in one config file, web parameter names?