Insert statement in try-with-resources block (java 7 or higher requires).