This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Tomcat and the fly likes implementing connection pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "implementing connection pooling" Watch "implementing connection pooling" New topic
Author

implementing connection pooling

vignesh dhakshinamoorthy
Greenhorn

Joined: Jan 21, 2009
Posts: 12
My Requirement:

STORED PROCEDURES:
==================

I have oracle Database as my back end. Presently i am using Prepared Statement to execute oracle queries.

For a good coding practice, i want to use Stored Procedures & call them from Java servlets.

How to do that?

CONNECTION POOLING:

===================

Every time i access the DB, i will create a new connection object which is not a good practice.

How to implement Connection Pooling in Java servlets.

======================================================================
Any Sample Code will be really helpful for both
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61457
    
  67

Please read this.

I have adjusted the topic title for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8935
    
    9

vignesh dhakshinamoorthy wrote:
For a good coding practice, i want to use Stored Procedures & call them from Java servlets.
How to do that?


Have a look at CallableStatement

vignesh dhakshinamoorthy wrote:
How to implement Connection Pooling in Java servlets.


Are you using Tomcat (I assume since you posted in the Tomcat forum)? Take a look at the JNDI how-to for the basics and the datasource how-to for some examples.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
vignesh dhakshinamoorthy
Greenhorn

Joined: Jan 21, 2009
Posts: 12
Thanks Joe.
I implemented Singleton pattern to achieve connection pooling.
 
 
subject: implementing connection pooling