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.
pool's state.