code: public void printQuery(final Query query) {
  	if (query != null) {
  	    final String[] cols = query.getColumns();
  	    final int rows = query.getRowCount();
  	    System.out.println("[Query:" + query.getName() + "]");
  	    for (int i = 0; i < cols.length; i++) {
  		if (i > 0) System.out.print(", ");
  		System.out.print(cols[i]);
  	    }
  	    System.out.println();
  
  	    for (int row = 1; row <= rows; row++) {
  		for (int col = 1; col <= cols.length; col++) {
  		    if (col > 1) System.out.print(", ");
  		    System.out.print(escapeString(query.getData(row, col)));
  		}
  		System.out.println();
  	    }
  	}
      }
docs: print out a query
  
  @param query query to print