473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Pool connection

rsrinivasan
221 100+
Hi all,

Im implementing pool connection in my web application. And im using dbcp.jar1.1 for pool connection. I do not know how to find free connection in the pool. If anyone know how to find this, reply me.

Thanks,
Feb 25 '08 #1
4 1281
JosAH
11,448 Expert 8TB
The dbcp pool takes care of that: when you ask it for a Connection it searches its
pool and returns you an available one if there is one. Otherwise it opens a new
Connection for you.

kind regards,

Jos
Feb 25 '08 #2
BigDaddyLH
1,216 Expert 1GB
Post the code you are currently using to get a connection.
Feb 25 '08 #3
rsrinivasan
221 100+
Post the code you are currently using to get a connection.
Thanks for reply..

This is my code to get the Pool connection..

Expand|Select|Wrap|Line Numbers
  1. private Connection getPoolConnection()
  2.     {
  3.             try
  4.         {
  5.             Context initctxt = new InitialContext();
  6.             Context envctxt = (Context)initctxt.lookup("java:comp/env");
  7.             DataSource dsrc = (DataSource)envctxt.lookup("jdbc/tri");
  8.             dbConnection = dsrc.getConnection();
  9.         }
  10.         catch(NamingException ne)
  11.         {
  12.             ne.printStackTrace();
  13.                     }
  14.         catch(SQLException sqle)
  15.         {
  16.             sqle.printStackTrace();
  17.         }
  18.         return dbConnection;
  19.     }
This is the configuration in "server.xml" file

Expand|Select|Wrap|Line Numbers
  1. <Environment name="maxExemptions" type="java.lang.Integer" value="15"/>
  2.           <Parameter name="context.param.name" value="context.param.value" override="false"/>
  3.           <Resource name="jdbc/tri" auth="Container" type="javax.sql.DataSource"/>
I want to know how much of connections are free at a time.
Feb 26 '08 #4
BigDaddyLH
1,216 Expert 1GB
I want to know how much of connections are free at a time.
Why do you need to know that?
Feb 26 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Martin | last post by:
Dear Group Sorry for posting this here. I'm desperate for a solution to this problem and thought some of you might have come across it with .NET and SQL Server. Let's assume I've the following...
3
by: Kamalanathan T. | last post by:
Hi, We have developed an Web application in ASP.NET with C# and we r using SQL Server 2000. We get the Timeout expired error, when more than 300 concurrent users hit the site. I hagone thru...
9
by: Abhishek Srivastava | last post by:
Hello All, In IIS 6.0 We have a concept of worker processes and application pools. As I understand it, we can have multiple worker process per appliction pool. Each worker process is dedicated...
7
by: greg | last post by:
Hi We have w2k, iis5, .NET/c# I periodically receive this message and the system freezes ++++++++++++++++++++++++++++++++++++++++++++++++++ Timeout expired. The timeout period elapsed...
5
by: DaM | last post by:
Hi guys, I'm having this problem with my ASP.Net application: I was testing the whole site, and it seem to work fine. Fast and stable, but suddenly it stopped working and this error occurred:...
1
by: mingki | last post by:
Hi Developers, I am a .Net developer of a Large Online Retailling Company. I would like to have your help on a Connection Pool issue. Recently we have developed a Web Application on ODP .Net...
8
by: Ike | last post by:
Is anyone aware of a means of connection pooling (to MySQL, say) in php? Thanks, Ike
2
by: JoeSep | last post by:
Hi! Is it correct/safe to define a connection pool in the string "sqlConnectionString" of the "sessionState" section of Web.config? - The application is developed using AspNet 1.1 in a Windows...
4
by: steven | last post by:
hi i've got an app that runs something like 4000 updates when certain pages are updated. it's taking on average 20 seconds for these pages to execute the update command (15 seconds if all i do...
2
by: Tony Johansson | last post by:
Hello! How does this connection pool function actually ? As I have been told is that when the connection is returned to the pool the connection to the database is still open. What you do is that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.