java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java
branchv_0
changeset 42 6fdaa4db3943
parent 36 025fbe816bbf
child 48 28735e71a1da
equal deleted inserted replaced
41:514df5061f59 42:6fdaa4db3943
   107 		} else {
   107 		} else {
   108 			FormatterDefinition fd = configuration.getFormatter(options.getFormatterName());
   108 			FormatterDefinition fd = configuration.getFormatter(options.getFormatterName());
   109 			if (fd == null) {
   109 			if (fd == null) {
   110 				throw new ConfigurationException("Formatter is not configured: " + options.getFormatterName());
   110 				throw new ConfigurationException("Formatter is not configured: " + options.getFormatterName());
   111 			} else {
   111 			} else {
   112 				DatabaseConnection c = dd.connect();
   112 				try (DatabaseConnection c = dd.connect()) {
   113 				Formatter f = fd.getInstance(new FormatterContext(options.getOutputStream()));
   113 					Formatter f = fd.getInstance(new FormatterContext(options.getOutputStream()));
   114 				c.executeQuery(options.getSQLCommand(), f);
   114 					c.executeQuery(options.getSQLCommand(), f);
       
   115 				}
   115 			}
   116 			}
   116 		}
   117 		}
   117 	}
   118 	}
   118 
   119 
   119 	private void processPrepareBatch() {
   120 	private void processPrepareBatch() {