-1

TL;DR:

How do we know which version of the tomcat-jdbc driver we need to use for a specific version of Tomcat?

Is there any reasonable documentation?

Longer Version

Over the years I have looked for a reasonable explanation on which tomcat-jdbc driver to use with a specific version of Tomcat. But I just haven't been able to find anything that says "For this version of tomcat, use this version of tomcat-jdbc driver."

My gut feeling is that the tomcat-jdbc version should be the same version as the tomcat server we're running. Is that a true statement?

Meaning, if we're running tomcat 9.0.65 we should be using the tomcat-jdbc 9.0.65?

Are there any links out there that specifically explain what to do?

Any friendly direction would be greatly appreciated.

hooknc
  • 4,854
  • 5
  • 31
  • 60
  • If their versioning is paired in a way that for every version `x.y.z` of tomcat, you have an `x.y.z` of tomcast-jdbc, then I would assume that their versions are linked, and thus should be kept in sync as you noted. – Rogue Dec 14 '22 at 17:31
  • what version of tomcat you are trying to use? – Constantine Ch Dec 14 '22 at 17:37
  • @Rogue, that is my assumption as well, it seems like the correlation between the tomcat server and tomcat-jdbc versions is high, but you know what they say about assumptions... – hooknc Dec 14 '22 at 17:42
  • @ConstantineCh, we are using the 9.0.65 version of tomcat. Most likely updating to the latest version of 9 (9.0.70) soonish. – hooknc Dec 14 '22 at 17:43
  • 4
    Maybe I am missing the point of the question (if so, apologies), but don't you just use whichever `tomcat-jdbc` JAR file (tomcat-jdbc.jar) comes bundled with the version of Tomcat you downloaded and are using? There is no need to make a choice - is there? Apart from that, I'm not sure you would choose `tomcat-jdbc` these days (unless for legacy reasons) as Tomcat also comes bundled with the newer `tomcat-dbcp` (the [default](https://stackoverflow.com/q/69662886/12567365))- or you can use a 3rd party pool provider. – andrewJames Dec 14 '22 at 18:58
  • @andrewJames good question. I will have to do some research on why we have the tomcat-jdbc as a dependency in our application. Thanks for the friendly direction. – hooknc Dec 14 '22 at 19:26

1 Answers1

1

Come to find out after some friendly direction by @andrewJames, the tomcat-jdbc library is provided by the Tomcat instance itself.

We most likely had the tomcat-jdbc in our pom.xml because it stopped red-lines in our Spring xml configuration files with missing Class names and attributes.

The person that originally added the tomcat-jdbc library to our pom should have scoped the library as 'provided'.

Then after a bit more research into Connection Pools we decided to switch to HikariCP due to its small package size and speed improvements over tomcat-jdbc.

hooknc
  • 4,854
  • 5
  • 31
  • 60