core-libs-dev Digest, Vol 13, Issue 1

Neal Gafter neal at
Mon May 5 14:09:03 UTC 2008

On Mon, May 5, 2008 at 5:54 AM, David M. Lloyd <david.lloyd at> wrote:
> On 05/03/2008 08:40 AM, Paulo Levi wrote:
> > Is it possible to make the java.sql interface Connection, Statement and
> > ResultSet descend from closeable?
> >
>  Not that I'm aware of, since SQLException doesn't extend IOException.  That
> said, it might be nice to have a java.sql.Closeable for some future JDBC...
>  I guess once you have that, you could do a java.lang.Closeable with a close
> method that throws Exception, and derive both and
> java.sql.Closeable from that. :-)

I think you want Closeable to be something like

  interface Closeable<X extends Exception> {
    void close() throws X;

Deciding how to do this is more of a Java SE specification issue than
an OpenJDK implementation issue.

More information about the core-libs-dev mailing list