My preferred pool would be org.apache.commons.jdbc2pool.Jdbc2PoolDataSource. However, org.apache.commons.dbcp.BasicDataSource could be used as well. Since both implement DataSource and are available via JNDI it makes no difference.
john mcnally On Tue, 2002-05-07 at 06:47, Eric Pugh wrote: > What would be the replacement for DBConnection? > > I am a little fuzzy on understanding database pools etc.. I thought Torque > used the commons pool and dbcp, but couldn't find it in CVS.. Would the > replacement be to use DBCP? > > If Torque doesn't use DBCP, why? I integrated DBCP with DbForms > (www.dbforms.org) to provide connection pooling, but if torque has a better > pool, I would like to use that instead. > > Eric > > -----Original Message----- > From: Bill Schneider [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 07, 2002 9:47 AM > To: Turbine Torque Developers List > Subject: Re: datasources from JNDI > > > > I created a branch, JDBC2POOL_BRANCH, to do this work. I was planning > > to merge this post 3.0 release. But the release process is moving very > > slowly. Maybe it would be better to eliminate DBConnection prior to the > > release? > > I don't get a vote but would +1 getting rid of DBConnection. > > > > - is there a good way to find out, at runtime, what database you're > > > connecting to? When all you have is a DataSource and a JNDI resource > name, > > > you have no way of knowing the underlying database, which Torque needs > to > > > know to pick the right database adapter. Is there some magic JDBC query > or > > > escape that lets you figure out your database? (conn.getClass() doesn't > > > work because it is usually wrapped by the pool, e.g., > > > org.apache.commons.dbcp.PoolableConnection) > > > > > > > I just introduced a property to specify the database type or adapter. > > This used to be specified separately from the driver property and tying > > them together has caused about as many questions as having the two > > properties. As you point out there is no way (or we have been unable to > > find a way) to keep the mapping using datasources. > > I may have found a way-- > conn.getMetaData().getDatabaseProductName() returns String > - returns "Oracle" in Oracle > - returns "MySQL" in mysql > - returns "PostgreSQL" in postgresql > > the DatabaseMetaData object returned by conn.getMetaData() seems to return a > bunch of other useful info too. > > -- Bill > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
