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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
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://aspose.com/file-tools
 
subject: From servlet, to Bean to JSP