Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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