-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ramesh,

peterramesh wrote:
> On reading Tomcat help doc 
> http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html, it
> recommends to place the MySQL  JDBC driver in both places (CATALINA_HOME/lib
> and WEB-INF/lib folder of the app).

I don't think so. The only place on that page where WEB-INF/lib is
referenced is here (as "application's lib folder"):

"
Note: placing these jars in both $CATALINA_HOME/lib and a web
application's lib folder will cause an error, so ensure you have them in
the $CATALINA_HOME/lib location only.
"

Putting your JDBC driver in both place is a recipe for pain.

> 1. Why Tomcat look for the JDBC jar to be in CATALINA_HOME/lib folder?

Tomcat creates the JNDI DataSource and loads your driver outside of the
webapp's ClassLoader. I'm not sure why it does this, but it does. That
requires you to make your driver available to Tomcat in CATALINA_HOME/lib.

> 2. If I copied more than one JDBC jars (with different version) in
> CATALINA_HOME/lib folder for couple of my applications, how each of them
> looks for the respective versions of JDBC driver?

They can't. It'll be completely random which version of the driver
"wins". If you /need/ different JDBC driver versions for the same
database, then you are better off with separate Tomcat instances.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmLa08ACgkQ9CaO5/Lv0PBFYwCfQOFXsDx64Vfpv/2W8nd+cF4N
zqsAnjVkrMEclBYZ0uZRxRpLjthoL1QE
=WQ7/
-----END PGP SIGNATURE-----

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

Reply via email to