java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java
branchv_0
changeset 36 025fbe816bbf
parent 34 9335cf31c0f2
child 42 6fdaa4db3943
equal deleted inserted replaced
35:b2ff3b2d58b2 36:025fbe816bbf
   105 		if (dd == null) {
   105 		if (dd == null) {
   106 			throw new ConfigurationException("Database is not configured: " + options.getDatabaseName());
   106 			throw new ConfigurationException("Database is not configured: " + options.getDatabaseName());
   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.getDatabaseName());
   110 				throw new ConfigurationException("Formatter is not configured: " + options.getFormatterName());
   111 			} else {
   111 			} else {
   112 				DatabaseConnection c = dd.connect();
   112 				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 			}