This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Using the Resultset obj from Dao layer to Jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Using the Resultset obj from Dao layer to Jsp page" Watch "Using the Resultset obj from Dao layer to Jsp page" New topic
Author

Using the Resultset obj from Dao layer to Jsp page

shiva valanukonda
Greenhorn

Joined: Sep 27, 2010
Posts: 25

Hi ,

I want to display the ResultSet object data which is fetched from the database on to the JSP page.
Initially i tried using the ResultSet directly into Jsp page by returning ResultSet obj from Dao Layer.
Like:
TestDaoImpl.java --> which will return the Obj as ResultSet.
TestServiceImpl.java --> which will call the ResultSet obj from DaoImpl.
ViewPage.jsp --> which will read the ResultSet Obj and iterate through the data and display the data.

But here, i want to know, how do we reduce the Database logic in Jsp page .

Thanks
Shiva
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60739
    
  65

Never pass a result set anywhere. You should copy the data from the result set into normal Java collections and/or beans and close the result set as soon as possible.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
wood burning stoves
 
subject: Using the Resultset obj from Dao layer to Jsp page
 
Similar Threads
Struts problem
Struts 1.2 :Sending data to DAO Layer from Action class through ActionForm or DTO Object ??
Displaying a table in JSP using JSTL tags
How to display records in Grid view format in Jsp
DAO help please