1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/Formatter.java Sun Dec 29 18:26:43 2013 +0100
1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/Formatter.java Mon Dec 30 00:01:39 2013 +0100
1.3 @@ -25,10 +25,10 @@
1.4 *
1.5 * @author Ing. František Kučera (frantovo.cz)
1.6 */
1.7 -public interface Formatter {
1.8 +public interface Formatter extends AutoCloseable {
1.9
1.10 void writeStartBatch();
1.11 -
1.12 +
1.13 void writeStartDatabase(DatabaseDefinition databaseDefinition);
1.14
1.15 void writeEndDatabase();
1.16 @@ -54,6 +54,13 @@
1.17 void writeUpdatedRowsCount(int updatedRowsCount);
1.18
1.19 void writeEndUpdatesResult();
1.20 -
1.21 +
1.22 void writeEndBatch();
1.23 +
1.24 + /**
1.25 + * If an error occurs (e.g. lost connection during result set reading) this method will be
1.26 + * called even if there was no {@linkplain #writeEndBach()}.
1.27 + */
1.28 + @Override
1.29 + void close() throws FormatterException;
1.30 }