This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 60053
    
  65

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: 8708
    
    6

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: implementing connection pooling
 
Similar Threads
Oracle Stored Procedures
Java & Oracle Stored Procedures
jdbc-servlets-connection pooling
Recommendations connecting to the database
Connection Pooling (Urgent)