aspose file tools
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 Groovy Fundamentals video training course this week in the Groovy 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: 26

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: 62777
    
  68

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]
 
jQuery in Action, 2nd edition
 
subject: Using the Resultset obj from Dao layer to Jsp page