jQuery in Action, 3rd edition
The moose likes JSP and the fly likes maintaining the database session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "maintaining the database session" Watch "maintaining the database session" New topic

maintaining the database session

amrita sankar

Joined: Jan 25, 2006
Posts: 26
hi all

I am developing an application in jsp that needs to access the database.
For this i am using jdbc and in connection.jsp i am establishing the connection.
I need to access the database in each and every page....
So as of now i am including the connection.jsp in every page...
Can i maintain a connection session so that i dont need to open the connection.jsp in each and every page....
Any pointers to this or any tutorialfor this ???

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

You are painting yourself into a corner of misery and pain.

Look into using a container-managed connection pool.

And for the love of heaven, keep the database access out of JSPs and in Java classes where it belongs.

[Asking smart questions] [About Bear] [Books by Bear]
wood burning stoves
subject: maintaining the database session
jQuery in Action, 3rd edition