wood burning stoves 2.0*
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


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: 61315
    
  66

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
 
GeeCON Prague 2014
 
subject: Constant JDBC Connection