we get this one for free!
jdbc resources [Connection
, Statement
, ResultSet
] have always offered a close() method. As of Java 7, those interfaces inherit AutoCloseable. When run under Java 7 api, even old implementations will inherit that interface. since they already have close() methods that do the right thing, these implementations will fulfill the contract of that interface.
so, try-with-resource should just work, without any modification, even under very old versions of the jdbc-implementing libraries.