This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Constant JDBC Connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Constant JDBC Connection" Watch "Constant JDBC Connection" New topic
Author

Constant JDBC Connection

Daniel Prene
Ranch Hand

Joined: Jul 15, 2005
Posts: 241
On my webpage visitors will frequently make database querys. Is it possible to run a connection in the background that all servlets will be able to tap into? Like a constantly logged in helper that is available to all servlets? How would I do this?

Thanks for atleast reading things,
-D.P.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60740
    
  65

Your best bet in such an environment is container-managed connection pooling.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

An old thread that discusses this in length just resurfaced today.
http://www.coderanch.com/t/360733/Servlets/java/it-good-carry-jdbc-Connection


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Constant JDBC Connection
 
Similar Threads
RequestDispatcher
Connection Pooling (Urgent)
Creating a method to average grades out
Can I Pool Connections to DB Across JSPs?
Maintaining scalability in servlets programming