Mercurial > hg > monetdb-java
diff src/main/java/nl/cwi/monetdb/jdbc/MonetStatement.java @ 378:02f353f62abe
Adjust UpdateResponse to allow for large updates (long instead of int).
Also change getLargeUpdateCount() to use this long count.
author | Martin van Dinther <martin.van.dinther@monetdbsolutions.com> |
---|---|
date | Fri, 25 Sep 2020 19:06:11 +0200 (2020-09-25) |
parents | 8a813f5cef1b |
children |
line wrap: on
line diff
--- a/src/main/java/nl/cwi/monetdb/jdbc/MonetStatement.java +++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetStatement.java @@ -929,16 +929,10 @@ public class MonetStatement */ @Override public int getUpdateCount() throws SQLException { - int ret = -1; - if (header != null) { - if (header instanceof MonetConnection.UpdateResponse) { - ret = ((MonetConnection.UpdateResponse)header).count; - } else if (header instanceof MonetConnection.SchemaResponse) { - ret = ((MonetConnection.SchemaResponse)header).state; - } - } - - return ret; + long ret = getLargeUpdateCount(); + if (ret >= Integer.MAX_VALUE) + return Integer.MAX_VALUE; + return (int)ret; } /** @@ -1218,7 +1212,16 @@ public class MonetStatement * method is called on a closed Statement */ public long getLargeUpdateCount() throws SQLException { - return getUpdateCount(); + long ret = -1; + if (header != null) { + if (header instanceof MonetConnection.UpdateResponse) { + ret = ((MonetConnection.UpdateResponse)header).count; + } else if (header instanceof MonetConnection.SchemaResponse) { + ret = ((MonetConnection.SchemaResponse)header).state; + } + } + + return ret; } /**