• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

implementing connection pooling

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please read this.

I have adjusted the topic title for you.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
vignesh dhakshinamoorthy
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Joe.
I implemented Singleton pattern to achieve connection pooling.
 
Oh. Hi guys! Look at this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic