This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes Servlets and the fly likes database interaction in jsps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "database interaction in jsps" Watch "database interaction in jsps" New topic

database interaction in jsps

Danish Shaukat
Ranch Hand

Joined: Nov 16, 1999
Posts: 340
Hi all!

Should the database interaction be done in a bean or a servlet when developing jsp applications.
Danish Shaukat
George Carlson

Joined: Aug 24, 2000
Posts: 15
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.
I agree. Here's the link:
subject: database interaction in jsps
It's not a secret anymore!