From: gk on
We write

Context ctx = new InitialContext()
javax.sql.DataSource ds = (DataSource)ctx.lookup("jdbc/oracleLink");
Connection con = ds.getConnection();

We get connection now. Is there any way to get minimum, current and
maximum number of connections in the pool at this part ?
From: Lew on
gk wrote:
> We write
>
> Context ctx = new InitialContext()
> javax.sql.DataSource ds = (DataSource)ctx.lookup("jdbc/oracleLink");
> Connection con = ds.getConnection();
>
> We get connection now.  Is there any way to get  minimum, current and
> maximum number of  connections in the pool at this part ?
>

I don't see a way using the java.* or javax.* SQL APIs. This part
would be the wrong place for that information anyway.

The whole point of connection pools is to provide the pooling facility
transparently, that is, in a way that looks to the application just
like a non-pooled connection. The segregation of pooling capability
from normal DataSource and Connection usage is deliberate.

There probably is a way using driver-specific calls. WebLogic has
management beans that can reveal this information:
<http://download.oracle.com/docs/cd/E14571_01/apirefs.1111/e13951/core/
index.html>
Click on "JDBCConnectionPoolParamsBean"

Meta-information about the connection should be logically separate
from actual use of the connection.

--
Lew
From: Arne Vajhøj on
On 26-06-2010 10:21, gk wrote:
> We write
>
> Context ctx = new InitialContext()
> javax.sql.DataSource ds = (DataSource)ctx.lookup("jdbc/oracleLink");
> Connection con = ds.getConnection();
>
> We get connection now. Is there any way to get minimum, current and
> maximum number of connections in the pool at this part ?

A regular app should not change behavior based on that information,
so it is not necessary.

If you are writing an app server management app, then it will be
app server specific and you can cast the connection to its
implementation class and access all types of extra information
available.

Arne


From: Robert Klemme on
On 06/26/2010 05:20 PM, Lew wrote:
> gk wrote:
>> We write
>>
>> Context ctx = new InitialContext()
>> javax.sql.DataSource ds = (DataSource)ctx.lookup("jdbc/oracleLink");
>> Connection con = ds.getConnection();
>>
>> We get connection now. Is there any way to get minimum, current and
>> maximum number of connections in the pool at this part ?
>>
>
> I don't see a way using the java.* or javax.* SQL APIs. This part
> would be the wrong place for that information anyway.
>
> The whole point of connection pools is to provide the pooling facility
> transparently, that is, in a way that looks to the application just
> like a non-pooled connection. The segregation of pooling capability
> from normal DataSource and Connection usage is deliberate.
>
> There probably is a way using driver-specific calls. WebLogic has
> management beans that can reveal this information:
> <http://download.oracle.com/docs/cd/E14571_01/apirefs.1111/e13951/core/
> index.html>
> Click on "JDBCConnectionPoolParamsBean"
>
> Meta-information about the connection should be logically separate
> from actual use of the connection.

Similar in JBoss which exhibits an MBean providing information about a
pool's state.

Kind regards

robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
From: gk on
On Jun 26, 8:20 pm, Lew <l...(a)lewscanon.com> wrote:
> gk wrote:
> > We write
>
> > Context ctx = new InitialContext()
> > javax.sql.DataSource ds = (DataSource)ctx.lookup("jdbc/oracleLink");
> > Connection con = ds.getConnection();
>
> > We get connection now.  Is there any way to get  minimum, current and
> > maximum number of  connections in the pool at this part ?
>
> I don't see a way using the java.* or javax.* SQL APIs.  This part
> would be the wrong place for that information anyway.
>
> The whole point of connection pools is to provide the pooling facility
> transparently, that is, in a way that looks to the application just
> like a non-pooled connection.  The segregation of pooling capability
> from normal DataSource and Connection usage is deliberate.
>
> There probably is a way using driver-specific calls.  WebLogic has
> management beans that can reveal this information:
> <http://download.oracle.com/docs/cd/E14571_01/apirefs.1111/e13951/core/
> index.html>
> Click on "JDBCConnectionPoolParamsBean"
>
> Meta-information about the connection should be logically separate
> from actual use of the connection.
>


I checked that link . I did not find "JDBCConnectionPoolParamsBean"
in the page . I also expanded the Left Hand Side collapsible + menu
for 'Runtine MBeans' but did not find
"JDBCConnectionPoolParamsBean" .

Could you please forward me the direct link ? or tell me the steps
where to find it.
I would be glad to work out this for weblogic server.

Regards