jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes Connection Pooling for my web application 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 » Databases » JDBC
Bookmark "Connection Pooling for my web application" Watch "Connection Pooling for my web application" New topic
Author

Connection Pooling for my web application

Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
I created connection pool classes. Now I want to use it for the entirely application (JSP and Servlet). Does anyon know how to get it to work? I know JSP can use the scope to set bean lifetime, is there a similar procedure for servlet to set scope too?
If I out the pool instatiation in the init() of my servlet, how can I passed the pool so other classes can use it?
Peter Tran
Bartender

Joined: Jan 02, 2001
Posts: 783
Adrian,
I think this article is exactly what you need.
-Peter
Adrian Yan
Ranch Hand

Joined: Oct 02, 2000
Posts: 688
Thanks for the article. But my concern is that, I use some classes for data gathering (or quesrying), how can I pass a connection object to the classes.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Try reading the article. It explains pretty clearly how to get a connection object from the connection pool.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection Pooling for my web application
 
Similar Threads
JavaBean in Servlet?
how to use JDBC Connection Pools in a standalone application?
is it good to carry the jdbc "Connection" over servlet and Actions ?
MVC2 outside servlet for testing
Keeping connection to a DB with Servlets JavaBeans