improve multiple results support v_0 tip
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 25 Jul 2020 17:25:19 +0200
branchv_0
changeset 252a9d4a8d5c57f
parent 251 97dbb1015d98
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
     1.1 --- a/java/sql-dk/src/main/java/info/globalcode/sql/dk/DatabaseConnection.java	Fri Dec 20 12:55:01 2019 +0100
     1.2 +++ b/java/sql-dk/src/main/java/info/globalcode/sql/dk/DatabaseConnection.java	Sat Jul 25 17:25:19 2020 +0200
     1.3 @@ -118,7 +118,7 @@
     1.4  			}
     1.5  			logWarnings(ps);
     1.6  
     1.7 -			while (ps.getMoreResults() || ps.getUpdateCount() > -1) {
     1.8 +			while (ps.getMoreResults() || ps.getUpdateCount() != -1) {
     1.9  				ResultSet rs = ps.getResultSet();
    1.10  				if (rs == null) {
    1.11  					processUpdateResult(ps, formatter);