You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by wolverine my <wo...@gmail.com> on 2006/06/27 05:56:43 UTC
JDBC jar in WEB-INF/lib?
Hi!
The Tomcat's MySQL DBCP example mentioned that we have to copy the
JDBC Driver's jar $CATALINA_HOME/common/lib. Do we allowed to copy the
jar to WEB-INF/lib? And how can we do that?
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: JDBC jar in WEB-INF/lib?
Posted by I D B Major <im...@compsci.bristol.ac.uk>.
wolverine my wrote:
> Hi!
>
> The Tomcat's MySQL DBCP example mentioned that we have to copy the
> JDBC Driver's jar $CATALINA_HOME/common/lib. Do we allowed to copy the
> jar to WEB-INF/lib? And how can we do that?
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
*Hi,
I'm no expert but the information I have read ( see
http://tomcat.apache.org/tomcat-4.1-doc/jndi-datasource-examples-howto.html
)
says;
NOTE:* Do not install these jarfiles in your |/WEB-INF/lib|, or
|$JAVA_HOME/jre/lib/ext|, or anywhere else. You will experience problems
if you install them anyplace other than |$CATALINA_HOME/common/lib|.
So I guess that you don't want to copy them to WEB-INF/lib. I'm using a
McKoi database but mine works fine with only one copy of the mckoidb.jar
in $CATALINA_HOME/common/lib
cheers,
Iain.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: JDBC jar in WEB-INF/lib?
Posted by Lou Caudell <lc...@wtceng.com>.
wolverine my wrote:
> Hi!
>
> The Tomcat's MySQL DBCP example mentioned that we have to copy the
> JDBC Driver's jar $CATALINA_HOME/common/lib. Do we allowed to copy the
> jar to WEB-INF/lib? And how can we do that?
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
I place the jdbc jar in the applications web-inf/lib directory, because
the other apps on the server do not use the same db exclusively.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: JDBC jar in WEB-INF/lib?
Posted by David Smith <dn...@cornell.edu>.
You can if you like. Just implement a ServletContextListener to setup a
DBCP pool for your webapp and store the resulting DataSource in the
ServletContext. Servlets and JSPs can pull it out of the ServletContext
later for use. Then have both the DBCP jar and the MySQL jar in your
WEB-INF/lib folder.
The only catch is your DataSource won't be available via JNDI any more.
The JNDI mechanism of tomcat requires your MySQL jar be in common/lib.
--David
wolverine my wrote:
> Hi!
>
> The Tomcat's MySQL DBCP example mentioned that we have to copy the
> JDBC Driver's jar $CATALINA_HOME/common/lib. Do we allowed to copy the
> jar to WEB-INF/lib? And how can we do that?
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org