This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc-servlets-connection pooling

 
manju latha
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello, i need to switch on to "connection pooling"
in my program, i have some idea about pooling.
currently i working on servlets. There could be one
lakh users who can hit our site for login(the connection
to the database). Database could be oracle or Ms-sql.
can any body help me here, what driver should i use
which can support connection pooling and how should be
the connection pool in my code.
a sample code is more helpful.
help is appreciated.
thanx.
 
sim sim
Ranch Hand
Posts: 55
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If you are using an app server like WebSphere or Weblogic, they will have an inbiult facility of DB connection pooling. Check up with yoour app server decumentation.
If you are going for a regular web-server, which is not an ideal situation, you can write your own Connection Pooling class here is one example form sun connection pooling
 
Axel Janssen
Ranch Hand
Posts: 2166
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use this one:
http://www.bitmechanic.com/projects/jdbcpool/
Sample code ships with download.
 
manju latha
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx for the response sim,
iam using Jakarta-tomcat application server
and oracle using servlets for the database connections
so u said that application server have an inbuilt facility
of DB connection pooling. but how would my code be
in the servlet for the database connection object..??
also how many max connections do i set for Jakarta ??
and how to set it..??
can u pl. help me again by explaining this.
thanx alot.
 
sim sim
Ranch Hand
Posts: 55
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I dont have much exp with tomcat, are u sure tomcat is an app server ? To my knowledge it is not.
Check out the documentation for connection pooling, I am sure u will get some pointers. Documentation of weblogic is pretty good, but again it is for weblogic.
I am really sorry my friend, as I said, I dont have much exp with tomcat.
 
Eric Fletcher
Ranch Hand
Posts: 188
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try DbConnectionBroker from JavaExchange.com. I've been using it on a relatively small scale app(i.e. ~100 users)and it works well so far. There are a couple implementation options explained in the readme that comes with the package.
Here is the link:
http://www.javaexchange.com/
Cheers
E
 
Mandar Risbud
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by manju latha:
thanx for the response sim,
iam using Jakarta-tomcat application server
and oracle using servlets for the database connections
so u said that application server have an inbuilt facility
of DB connection pooling. but how would my code be
in the servlet for the database connection object..??
also how many max connections do i set for Jakarta ??
and how to set it..??
can u pl. help me again by explaining this.
thanx alot.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic