testcontainers-java
testcontainers-java copied to clipboard
chore: refactor JDBC tests to avoid leaking DataSource & friends
performQuery() is leaking DataSources, Connections and Statements.
Chances are it's also leaking ResutSets, unless a caller closes it. This is an attempt to fix it.
I kept the leaky method as there can be users outside the main repo.
I stumbled upon this while working on https://github.com/testcontainers/testcontainers-java/pull/5606
btw- if you think this is overkill then feel free to close it. no hard feelings :)