This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
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

database interaction in jsps

 
Danish Shaukat
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!

Should the database interaction be done in a bean or a servlet when developing jsp applications.
Regards
Danish Shaukat
 
George Carlson
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do my actual database interaction using a bean, but I access it through a jsp using the <jsp:useBean id="db" class="ConnectionPool" scope="appliction" /> and then when accessing it, just use db.method. If you need to use it inside another bean, you can just pass it to the bean as a parameter.
If you want my ConnectionPool code, I can pass that to you also.
Mike
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic