I'm trying to sort out the relationship between a JDK version and a JDBC driver type - in the context of implementing some program that uses the driver.
Using an example to explain my question: given a Java 8 runtime, I know that I can use try-with-resource to automatically clean up database connection and related resources. However, do I also need to make sure that the JDBC driver installed alongside my program is of type 4.1 or higher? what will happen if the database vendor only supplies type 3 or 2 driver? will I get a runtime error? or will it silently fail to clean up the resources? or will it work just fine?
try-with-resource is just an example - my question isn't specifically related to that, but is more around what are the consideration one should take into account when going about developing a program to access some database using JDBC? should I go by the driver type first and then infer from it which java features I can use? should I just go by the java version and things will magically work well?