private void doEscape(String str)
		throws IOException, SQLException, SyntaxException  {

		String rest = null;
		if (str.length() > 2) {
			rest = str.substring(2);
		}

		if (str.startsWith("\\d")) {	// Display
			if (rest == null){
				throw new SyntaxException("\\d needs display arg");
			}
			display(rest);
		} else if (str.startsWith("\\m")) {	// MODE
			if (rest == null){
				throw new SyntaxException("\\m needs output mode arg");
			}
			setOutputMode(rest);
		} else if (str.startsWith("\\o")){
			if (rest == null){
				throw new SyntaxException("\\o needs output file arg");
			}
			setOutputFile(rest);
		} else if (str.startsWith("\\q")){
			exit(0);
		} else {
			throw new SyntaxException("Unknown escape: " + str);
		}
	}