You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Garth Keesler <ga...@gdcjk.com> on 2007/01/18 15:14:47 UTC

Connection sharing question

The more I read, the less sure I am of what I know... :-)

Is it true that DBCP running with Tomcat provides sharing of database 
connections across separate invocations of different web services (on 
the same Tomcat server) that use the same database?

Thanx,
Garth

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Connection sharing question

Posted by Garth Keesler <ga...@gdcjk.com>.
Thanx much for the reply. I think I'm beginning to understand. What's 
more, it seems to be working! :-)

Garth

Jiaqi Guo wrote:
> Garth Keesler wrote:
>> The more I read, the less sure I am of what I know... :-)
>>
>> Is it true that DBCP running with Tomcat provides sharing of database 
>> connections across separate invocations of different web services (on 
>> the same Tomcat server) that use the same database?
>>
>> Thanx,
>> Garth
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
> http://confluence.atlassian.com/display/DOC/Configuring+a+MySQL+Datasource+in+Apache+Tomcat 
> is a document for configuring JIRA and a good example of how a global 
> DBCP DataSource is defined in Tomcat.
>
> Basically you can declare it in Tomcat server.xml, refer it in web.xml 
> and get the DataSource in code through JNDI.
>
> Make sure to put the commons-jdbc and JDBC driver jar file into 
> <tomcat_install_dir>/common/lib rather than <webapp_dir>/WEB-INF/lib.
>
> Hope it helps. Good luck.
>
>
>
>
> Regards
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Connection sharing question

Posted by Jiaqi Guo <cy...@gmail.com>.
Garth Keesler wrote:
> The more I read, the less sure I am of what I know... :-)
>
> Is it true that DBCP running with Tomcat provides sharing of database 
> connections across separate invocations of different web services (on 
> the same Tomcat server) that use the same database?
>
> Thanx,
> Garth
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
http://confluence.atlassian.com/display/DOC/Configuring+a+MySQL+Datasource+in+Apache+Tomcat 
is a document for configuring JIRA and a good example of how a global 
DBCP DataSource is defined in Tomcat.

Basically you can declare it in Tomcat server.xml, refer it in web.xml 
and get the DataSource in code through JNDI.

Make sure to put the commons-jdbc and JDBC driver jar file into 
<tomcat_install_dir>/common/lib rather than <webapp_dir>/WEB-INF/lib.

Hope it helps. Good luck.




Regards

-- 

Jiaqi Guo
http://www.cyclopsgroup.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org