--- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/Formatter.java Sun Dec 29 18:26:43 2013 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/Formatter.java Mon Dec 30 00:01:39 2013 +0100
@@ -25,10 +25,10 @@
*
* @author Ing. František Kučera (frantovo.cz)
*/
-public interface Formatter {
+public interface Formatter extends AutoCloseable {
void writeStartBatch();
-
+
void writeStartDatabase(DatabaseDefinition databaseDefinition);
void writeEndDatabase();
@@ -54,6 +54,13 @@
void writeUpdatedRowsCount(int updatedRowsCount);
void writeEndUpdatesResult();
-
+
void writeEndBatch();
+
+ /**
+ * If an error occurs (e.g. lost connection during result set reading) this method will be
+ * called even if there was no {@linkplain #writeEndBach()}.
+ */
+ @Override
+ void close() throws FormatterException;
}