Java 6 breaks your Connections

Published: 4:11 PM GMT+12, Thursday, 29 November 2007 under: technology
java  sql 

So there I was, setting up a nice new TeamCity based build server running Java 6 and start adding in projects, watching them build, and smiling. Until I came to project X which died with the following errors:

  • DeadLockConnection is not abstract and does not override abstract method createStruct(java.lang.String,java.lang.Object[]) in java.sql.Connection
  • DeadLockPreparedStatement is not abstract and does not override abstract method setNClob(int,java.io.Reader) in java.sql.PreparedStatement

Looking at the current Javadoc for the Connection class I see that createStruct() was added to 1.6 (along with quite a few other classes not reported in the initial build failure). I guess I still don't fully understand Java's class loading foo - I would have thought existing classes that don't implement the new method would cause the class to not load - or maybe it loads the class and just throws an InvalidMethodException or something at runtime. Either way - this is sure to break a lot of applications.

Or maybe I'm just wrong... Either way I guess it's back to Java 5 for me.

Comments (0)

Add Comment