wood burning stoves 2.0*
The moose likes JDBC and the fly likes Connection Pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection Pooling" Watch "Connection Pooling" New topic
Author

Connection Pooling

Glenny Dsilva
Ranch Hand

Joined: May 09, 2005
Posts: 42
I have tried connection pooling according to the documentation given
in tomcat 5.0.18, its working fine.

But in my project I need to connect to 2 databases from one context.
According to a given parameter can i connect to a particular
database using a connection pool.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Different database == different DataSource (and therefore a differernt connection pool). So long as you have two DataSources configured it should be trivial to swap between the two.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
You can go for two seperate pools.
Glenny Dsilva
Ranch Hand

Joined: May 09, 2005
Posts: 42
Thanks a lot its working fine now

One more doubt I wanna clear is that on mysql server i get the process list

as given below

Id UserHostdbCommand Time

142root localhost:1531javatestSleep10

I cannot understand why do i get the above process list i.e. in Sleep mode

Is it okay or what is the procedure to kill the process or close the connection

I have closed the connection in the class file using con.close()

I have also added the abandoned db connection in the xml code i.e. below

<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>
 
 
subject: Connection Pooling
 
Similar Threads
How to do Connection Pooling
entity bean in weblogic81.
Connection Pooling
Database Connection without connection pooling
Hibernate and connection pooling