public void runXQuery(XQuery xquery, boolean scrollResult, boolean showTime) { try { XQDataSource dataSource = getDataSource(); XQRunner runner = dataSource.newSyncRunner(); long start = System.currentTimeMillis(); XQResult result = runner.runQuery(xquery); long end = System.currentTimeMillis(); double total = (double)(end - start)/1000;  try { boolean stop = false; int lineCount = 0; for( int x = 0; x < result.getSize(); x++) { XQResultItem item = result.getItem(x);  BufferedReader reader = getReader(item); String line = null; while((line = reader.readLine()) != null) { lineCount++; printLine(line); if( scrollResult && checkStopScroll(lineCount) ) { stop = true; break; } } reader.close(); if(stop) { break; } } } catch(IOException e) { printLine("Failed to read result string: " + e.getMessage()); }  DecimalFormat format = new DecimalFormat("###,##0.00"); if(showTime) { printLine("\nDone (" + format.format(total) + " sec)"); } } catch(XQException e) { printError(e); }
public void runXQuery(XQuery xquery) { runXQuery(xquery, true, true);
    public void runXQuery(XQuery xquery, boolean scrollResult, boolean showTime) {        try {            XQDataSource dataSource = getDataSource();            XQRunner runner = dataSource.newSyncRunner();            long start = System.currentTimeMillis();            XQResult result = runner.runQuery(xquery);            long end = System.currentTimeMillis();            double total = (double)(end - start)/1000;            try {				boolean stop = false;				int lineCount = 0;				for( int x = 0; x < result.getSize(); x++) {					XQResultItem item = result.getItem(x);										BufferedReader reader = getReader(item);					String line = null;					while((line = reader.readLine()) != null) {						lineCount++;						printLine(line);						if( scrollResult && checkStopScroll(lineCount) ) {							stop = true;							break;						}					}					reader.close();					if(stop) {						break;					}				}            } catch(IOException e) {                printLine("Failed to read result string: " + e.getMessage());            }            DecimalFormat format = new DecimalFormat("###,##0.00");            if(showTime) {                printLine("\nDone (" + format.format(total) + " sec)");            }        } catch(XQException e) {			printError(e);        }    }