This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

database interaction in jsps  RSS feed

 
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!