File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "maintaining the database session" Watch "maintaining the database session" New topic
Author

maintaining the database session

amrita sankar
Greenhorn

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 ???

Sankar
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

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] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: maintaining the database session
 
Similar Threads
How do Javabeans work?
Doubt in JavaServerPages and in JavaBeans???
Database Connection and Session
connection object into session...
Advice needed on how to connect to a database in JSP