[JDBC] Should we still put the driver in CATALINA_HOME/lib and not in theapplication's war? - Mailing list pgsql-jdbc

From Miguel Almeida
Subject [JDBC] Should we still put the driver in CATALINA_HOME/lib and not in theapplication's war?
Date
Msg-id CA+AeW314mUadQcLGXWSm410xXmsdJ4ZXG5opKU1=2YTi_Gv4pw@mail.gmail.com
Whole thread Raw
Responses Re: [JDBC] Should we still put the driver in CATALINA_HOME/lib andnot in the application's war?  (Dave Cramer <pg@fastcrypt.com>)
Re: Should we still put the driver in CATALINA_HOME/lib andnot in the application's war?  (Dave Cramer <pg@fastcrypt.com>)
List pgsql-jdbc
Dear all,

I recently revisited the decision in my projects to put both the postgresql and c3p0 driver in Tomcat's lib directory instead of putting it in each application's package (see the stackoverflow post below [1], still unresolved!).

In 2011 Philip Reichart mentioned that JDBC drivers register themselves in the JVM-wide singleton DriverManager which is shared by all web apps. If you have the same (as in class name) JDBC driver register twice from two different web apps, this might cause your problem. This is even more problematic if your web apps use different versions of the same JDBC driver.

Is this still the case in 2017?

The reason why this may become problematic is that my team is having difficulties upgrading the postgresql driver from version x to y, which may lead to the need to have different postgresql driver versions for different applications within the same tomcat container.
Can you kindly help me underestand the consequences of that?


[1] https://stackoverflow.com/questions/45621073/where-to-put-c3p0-dependency-in-tomcat-container

[2] https://stackoverflow.com/a/7198049/475829

Thank you very much for your input!

Miguel Almeida

pgsql-jdbc by date:

Previous
From: Zemian Deng
Date:
Subject: [pgjdbc/pgjdbc] cd7769: fix: correct javadoc onPGResultSetMetaData.getFor...
Next
From: Dave Cramer
Date:
Subject: Re: [JDBC] Should we still put the driver in CATALINA_HOME/lib andnot in the application's war?