Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using the Resultset obj from Dao layer to Jsp page

 
shiva valanukonda
Greenhorn
Posts: 26
Hibernate jQuery Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65111
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic