Is there some hack to create a wrapper for java.sql.Connection which works with JDBC 3 and 4 (Sun added a couple of methods and new types to the interface for JDBC 4) without resorting to something which patches the source at compile time?
My use case is that I need to generate a library which works with Java 5 and 6 and I'd really like to avoid creating two versions of it.