If you are using JDK 1.7, you could embed stuff on a closable interface, and it would be closed as soon as out of scope. We are working on implementing that on JMS 2, but meanwhile you could embed your own class delegating stuff. You will have to keep stuff referenced somewhere in your thread so it will only go out of scope when the thread is gone. (Thread local maybe?)
you need to use try (statement=statement.open()) {} and auto closeable would be called