0

I have to deploy to tomcat7 server, an application that connect to two databases:

  • Oracle Database 12.1.0.2 which need the ojdbc7.jar
  • Oracle Database 11.2.0.4 which uses ojdbc6.jar

enter image description here

I created two datasources that uses the same class from both libs, now I need to copy libs into $CATALINA_HOME/lib, I fear ending up with calssloader conflit as the two jars share many classes with same className.

type="javax.sql.DataSource"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="oracle.jdbc.OracleDriver"

How to deal with that ?

storm
  • 379
  • 1
  • 9
  • 23
  • "Oracle Database 12c Release 1 (12.1) JDBC drivers are certified with supported Oracle Database releases (11.x.0.x). However, they are not certified to work with older, unsupported database releases, such as 10.2.x, 10.1.x, 9.2.x, and 9.0.1.x." https://docs.oracle.com/database/121/JJDBC/getsta.htm#JJDBC20000 – tgdavies Jul 03 '20 at 07:30
  • independently from databases versions (assuming I have 2 db with no commun compatible driver) is it ever possible to have 2 datasources for them ? – storm Jul 03 '20 at 07:45
  • I think it would be hard with a single web app. You could have two web apps with the driver in their WEB-INF/lib directories, or create OSGi bundles perhaps. – tgdavies Jul 03 '20 at 07:53
  • 1
    Generally the drivers are [supposed](https://stackoverflow.com/questions/756208/oracle-jdbc-driver-version-madness) to be backwards compatible, even if they may not be *certified* to be. Almost everything is possible, and having two datasources with different version drivers isn't nearly the worst thing you could imagine trying to get to work, but I wouldn't try to solve it in code as the first step. – Kayaman Jul 03 '20 at 08:15

0 Answers0