You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Edoardo Panfili <ed...@aspix.it> on 2009/03/23 21:58:19 UTC

can I use org.apache.tomcat.dbcp.dbcp.BasicDataSource ?

Hy,

can I use "org.apache.tomcat.dbcp.dbcp.BasicDataSource" in place of 
"org.apache.commons.dbcp.BasicDataSource"?
If yes I can avoid to put commons-pool and commons-dbcp in my webapp lib 
folder.
Looking at Tomcat build.xml seems that the two names refers to the same 
thing.

thank you
Edoardo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: can I use org.apache.tomcat.dbcp.dbcp.BasicDataSource ?

Posted by Edoardo Panfili <ed...@aspix.it>.
Filip Hanik - Dev Lists ha scritto:
> you sure can,
> you can also use org.apache.tomcat.jdbc.pool.DataSource
Charles advise to me that is a better policy to use with caution 
internal Tomcat classes, indeed my question rises from this reason.

I don't want to save disk space (2 jars uses less space than few jpegs) 
but I like to build polite application with no duplicate code. And less 
dependences sounds like less probability to do mistakes.

If inside Tomcat library I can find the class that I must use is not 
useful to insert another library in my application.

It is also true that my application with dbcp jars is more portable (not 
a project requisite yet).

All more theoretical than practical.

thank you again
Edoardo


> 
> http://tomcat.apache.org/dev/dist/jdbc-pool/1.0-beta/
> 
> Filip
> 
> Edoardo Panfili wrote:
>> Hy,
>>
>> can I use "org.apache.tomcat.dbcp.dbcp.BasicDataSource" in place of 
>> "org.apache.commons.dbcp.BasicDataSource"?
>> If yes I can avoid to put commons-pool and commons-dbcp in my webapp 
>> lib folder.
>> Looking at Tomcat build.xml seems that the two names refers to the 
>> same thing.
>>
>> thank you
>> Edoardo
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: can I use org.apache.tomcat.dbcp.dbcp.BasicDataSource ?

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
you sure can,
you can also use org.apache.tomcat.jdbc.pool.DataSource

http://tomcat.apache.org/dev/dist/jdbc-pool/1.0-beta/

Filip

Edoardo Panfili wrote:
> Hy,
>
> can I use "org.apache.tomcat.dbcp.dbcp.BasicDataSource" in place of 
> "org.apache.commons.dbcp.BasicDataSource"?
> If yes I can avoid to put commons-pool and commons-dbcp in my webapp 
> lib folder.
> Looking at Tomcat build.xml seems that the two names refers to the 
> same thing.
>
> thank you
> Edoardo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: can I use org.apache.tomcat.dbcp.dbcp.BasicDataSource ?

Posted by Edoardo Panfili <ed...@aspix.it>.
Caldarale, Charles R ha scritto:
>> From: Edoardo Panfili [mailto:edoardo@aspix.it] 
>> Subject: Re: can I use org.apache.tomcat.dbcp.dbcp.BasicDataSource ?
>>
>> I am using opejpa and it seems to need an explicit connection-pool.
> 
> I have no experience with OpenJPA, but I would caution against direct use of Tomcat's internal classes, regardless of whether or not they match what commons-dbcp does.  Just put the public jars in your webapp; disk space is cheap.
> 
> Note that some JDBC drivers also include their own optional pooling mechanism.

Thank you for all the answers and the patience, I'll put the jars from 
Apache commons in my application.

Edoardo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: can I use org.apache.tomcat.dbcp.dbcp.BasicDataSource ?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Edoardo Panfili [mailto:edoardo@aspix.it] 
> Subject: Re: can I use org.apache.tomcat.dbcp.dbcp.BasicDataSource ?
> 
> I am using opejpa and it seems to need an explicit connection-pool.

I have no experience with OpenJPA, but I would caution against direct use of Tomcat's internal classes, regardless of whether or not they match what commons-dbcp does.  Just put the public jars in your webapp; disk space is cheap.

Note that some JDBC drivers also include their own optional pooling mechanism.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: can I use org.apache.tomcat.dbcp.dbcp.BasicDataSource ?

Posted by Edoardo Panfili <ed...@aspix.it>.
On 23-03-2009 22:42, Caldarale, Charles R wrote:
>> From: Edoardo Panfili [mailto:edoardo@aspix.it]
>> Subject: can I use org.apache.tomcat.dbcp.dbcp.BasicDataSource ?
>>
>> can I use "org.apache.tomcat.dbcp.dbcp.BasicDataSource" in place of
>> "org.apache.commons.dbcp.BasicDataSource"?
>
> You do that by letting Tomcat manage the connection pool:
> http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
>
> (Adjust the above link for the version of Tomcat you're using, which you didn't bother to tell us.)
It's 6.0.18 (sorry). Under OS X (java 1.5) and Linux (java 1.6).

I am using opejpa and it seems to need an explicit connection-pool. I 
did some test and I can achieve better performances if I use 
connection-pools, no differences between tomcat-dbcp and "plain"-dbcp.

Edoardo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: can I use org.apache.tomcat.dbcp.dbcp.BasicDataSource ?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Edoardo Panfili [mailto:edoardo@aspix.it] 
> Subject: can I use org.apache.tomcat.dbcp.dbcp.BasicDataSource ?
> 
> can I use "org.apache.tomcat.dbcp.dbcp.BasicDataSource" in place of 
> "org.apache.commons.dbcp.BasicDataSource"?

You do that by letting Tomcat manage the connection pool:
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html

(Adjust the above link for the version of Tomcat you're using, which you didn't bother to tell us.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org