wood burning stoves 2.0*
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
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: 60822
    
  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]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Using the Resultset obj from Dao layer to Jsp page
 
Similar Threads
DAO help please
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