File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 63838

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]
I agree. Here's the link:
subject: maintaining the database session
It's not a secret anymore!