The following code fragment is used to auto create the datasource pool
and you can then use tds.getMaxWait etc. not sure if this is going to
help you with a tomcat specified connection pool but might give you some
pointers...
DriverAdapterCPDS cpds = new DriverAdapterCPDS();
ConnectionDetails objDetails = new
ConnectionDetails(datasource);
try {
cpds.setDriver(objDetails.getDriver()); //
"org.gjt.mm.mysql.Driver"
} catch (ClassNotFoundException e) {
log.error(e.getMessage());
log.debug("StackTrace : ", e);
}
cpds.setUrl(objDetails.getUrl()); //
"jdbc:mysql://localhost:3306/bookstore"
cpds.setUser(objDetails.getUsername());
cpds.setPassword(objDetails.getPassword());
SharedPoolDataSource tds = new SharedPoolDataSource();
tds.setConnectionPoolDataSource(cpds);
tds.setMaxActive(Config.getParamAsInt("pool.max.active"));
tds.setMaxWait(Config.getParamAsInt("pool.max.wait"));
tds.setMaxIdle(Config.getParamAsInt("pool.max.idle"));
tds.setTestOnBorrow(Config.getParamAsBoolean("pool.test.on.borrow"));
tds.setTestOnReturn(Config.getParamAsBoolean("pool.test.on.return"));
tds.setTestWhileIdle(Config.getParamAsBoolean("pool.test.while.idle"));
> -----Original Message-----
> From: GF [mailto:[email protected]]
> Sent: 03 November 2010 11:16
> To: Tomcat Users List
> Subject: Discover the Datasource connection pool maxSize.
>
> Hello.
> i've not access to Tomcat's server.xml where the sysadmins defined a
resource:
>
> <Resource driverClassName="oracle.jdbc.driver.OracleDriver"
> maxActive="65" maxIdle="30" maxWait="5" name="myDatasource"
> type="javax.sql.DataSource" url="jdbc:....." />
>
> I wish to discover from a web appplication deployed on that Tomcat
> what's the configuration "maxActive" for myDatasource.
>
> Is there a way to discover it?
> Thank you.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]