• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connection Pool

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to create a class for pooling my connection to my oracle database
I have generated a factory Class named 'ConnectionPool'
public class ConnectionPool {
static Pool p = new Pool();

public ConnectionPool() {
super();
}
}
which will create an Object of the 'Pool' Class and then
I have used this Object to retreive my connection.
The 'Pool' class is as follows
public class Pool {
static Connect1 c = new Connect1();
static Connection con;

public Pool()
{
con = c.connectToOracle();
}
}
The Connect1 class is working fine and returning a valid connection to me.
I would like you to Go through the code and Suggest me enhancements. I also want to create say 20 Connections and use them one after the other. (In the above program there is only one Connection and I'm just pasiing the refernce to my utility programs.)
Please do help
Thanks in advance
C Balajee
 
Bartender
Posts: 783
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
C,
JDBC 2.0 extension supports ConnectionPooling. Read this article to learn how.
-Peter
Ps. Please check JavaRanch's naming policy.
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am moving this thread to JDBC forum.
------------------

Ajith Kallambella M.
Sun Certified Programmer for the Java2 Platform.
 
C Balajee
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ajith and Peter.
C.Balajee
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic