Prev: Call for Papers Reminder (extended): World Congress on Engineering and Computer Science WCECS 2010
Next: How to check if object is an instanceof a class, but not a sub-class ?
From: gk on 27 Jun 2010 10:55 On Jun 27, 7:32 pm, gk <src...(a)gmail.com> wrote: > 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 I have found this here ... http://download.oracle.com/docs/cd/E11035_01/wls100/wlsmbeanref/core/index.html I see it has InitialCapacity --This is also the minimum number of physical connections the connection pool will keep available. MaxCapacity -- The maximum number of physical connections that this connection pool can contain. But there seems NO attribute to tell how many connections are in USE now . Is there any way out for this
From: Lew on 27 Jun 2010 11:23 Lew wrote: >> <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. gk wrote: > 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. Click on the link. "Configuration MBeans" "System Module MBeans" "JDBCConnectionPoolParamsBean" -- Lew
From: Lew on 27 Jun 2010 11:24 gk wrote: >> "JDBCConnectionPoolParamsBean" . .... > I have found this here ... > > http://download.oracle.com/docs/cd/E11035_01/wls100/wlsmbeanref/core/index.html > > I see it has > > InitialCapacity --This is also the minimum number of physical > connections the connection pool will keep available. > > MaxCapacity -- The maximum number of physical connections that this > connection pool can contain. > > > But there seems NO attribute to tell how many connections are in USE > now . > > Is there any way out for this[?] Dig through the documentation for your DataSource provider. Why do you want it? -- Lew
From: steph on 27 Jun 2010 18:15 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 ? DataSource does not imply a pool of connection. I is perfectly right to create a datasource with one connection.
From: Arne Vajhøj on 28 Jun 2010 21:34
On 27-06-2010 18:15, steph 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 ? > > DataSource does not imply a pool of connection. > I is perfectly right to create a datasource with one connection. Sure. But a JNDI lookup indicates app server (incl. servlet container only) context. And I can not remember one of those that provide data sources that are not a connection pool. Arne |