improve multiple results support v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 25 Jul 2020 17:25:19 +0200
branchv_0
changeset 252 a9d4a8d5c57f
parent 251 97dbb1015d98
child 253 d8442b266ca8
improve multiple results support The specification talks exactly about -1: > Returns: the current result as an update count; > -1 if the current result is a ResultSet object or there are no more results Other negative numbers can theoretically mean something different than „no more results“ e.g. unknown number of updates (?).
java/sql-dk/src/main/java/info/globalcode/sql/dk/DatabaseConnection.java
--- a/java/sql-dk/src/main/java/info/globalcode/sql/dk/DatabaseConnection.java	Fri Dec 20 12:55:01 2019 +0100
+++ b/java/sql-dk/src/main/java/info/globalcode/sql/dk/DatabaseConnection.java	Sat Jul 25 17:25:19 2020 +0200
@@ -118,7 +118,7 @@
 			}
 			logWarnings(ps);
 
-			while (ps.getMoreResults() || ps.getUpdateCount() > -1) {
+			while (ps.getMoreResults() || ps.getUpdateCount() != -1) {
 				ResultSet rs = ps.getResultSet();
 				if (rs == null) {
 					processUpdateResult(ps, formatter);