Java 6 and JDBC 4.0

I just migrated a 4,000+ Java class project from Java 1.4.2 to Java 6. I’ve already mentioned some of the issues to be aware of when migrating a large code base to Java 6. In Java 6, enum is a reserved keyword so I had to renaming variables that had that name, I also had to upgrade to a more recent version of Apache Commons Lang for a similar reason. I also had minor issues compilation issues, such as the removal of compareTo(Object obj) method was removed from the String class, and Apache classes that once shipped with the JRE 1.4.2 where removed.

But what irked me the most about Java 6 was recent changes to JDBC 4.0. The ResultSet interface, in Java 6, has 197 methods that need be be implemented if you are working with custom ResultSet implementation. I am just shocked at the sheer number of methods required for a basic ResultSet, most of which are not used, or will ever be used by our custom implementation! This is what is wrong with Java. The good thing is that Eclipse auto code generation features saved me from typing all of those methods but I wished there was a basic ‘do nothing’ abstract adapter like WindowAdapter.

Technorati Tags: , , , , , ,