--- a/java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java Sun Dec 29 18:26:43 2013 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java Mon Dec 30 00:01:39 2013 +0100
@@ -141,8 +141,9 @@
FormatterDefinition fd = configuration.getFormatter(options.getFormatterName());
try (DatabaseConnection c = dd.connect()) {
log.log(Level.FINE, "Database connected");
- Formatter f = fd.getInstance(new FormatterContext(options.getOutputStream()));
- c.executeQuery(options.getSQLCommand(), f);
+ try (Formatter f = fd.getInstance(new FormatterContext(options.getOutputStream()))) {
+ c.executeQuery(options.getSQLCommand(), f);
+ }
}
}