diff -r 03bf24449c7a -r 102ba0fcb07f java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularPrefetchingFormatter.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularPrefetchingFormatter.java Sat Dec 28 12:19:39 2013 +0100
@@ -0,0 +1,124 @@
+/**
+ * SQL-DK
+ * Copyright © 2013 František Kučera (frantovo.cz)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package info.globalcode.sql.dk.formatting;
+
+import info.globalcode.sql.dk.Parameter;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Prefetches whole result set and computes column widths. Whole table is flushed at once in
+ * {@linkplain #writeEndResultSet()}.
+ *
+ * Long values will not overflow the cells, but whole result set must be loaded into memory.
+ *
+ * @author Ing. František Kučera (frantovo.cz)
+ */
+public class TabularPrefetchingFormatter extends TabularFormatter {
+
+ public static final String NAME = "tabular-prefetching"; // bash-completion:formatter
+ private String currentSql;
+ private List extends Parameter> currentParameters;
+ private ColumnsHeader currentHeader;
+ private List