comparison src/main/java/org/monetdb/jdbc/MonetConnection.java @ 428:0b808a4d4f1f

Catch and warn about invalid fetch sizes.
author Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
date Mon, 08 Feb 2021 12:23:13 +0100 (2021-02-08)
parents 95d15f1d750d
children e4e104f8146c
comparison
equal deleted inserted replaced
427:e79bfbd0553e 428:0b808a4d4f1f
204 if (hash != null) 204 if (hash != null)
205 conn_props.setProperty("hash", hash); 205 conn_props.setProperty("hash", hash);
206 206
207 final String fetchsize_prop = props.getProperty("fetchsize"); 207 final String fetchsize_prop = props.getProperty("fetchsize");
208 if (fetchsize_prop != null) { 208 if (fetchsize_prop != null) {
209 int fetchsize = Integer.parseInt(fetchsize_prop); 209 try {
210 if (fetchsize > 0) { 210 int fetchsize = Integer.parseInt(fetchsize_prop);
211 this.defaultFetchSize = fetchsize; 211 if (fetchsize > 0) {
212 conn_props.setProperty("fetchsize", fetchsize_prop); 212 this.defaultFetchSize = fetchsize;
213 } else { 213 conn_props.setProperty("fetchsize", fetchsize_prop);
214 addWarning("Fetch size must be positive. Value ignored", "M1M05"); 214 } else {
215 addWarning("Fetch size must be positive. Value ignored", "M1M05");
216 }
217 } catch (java.lang.NumberFormatException e) {
218 addWarning("Invalid fetch size. Value ignored", "M1M05");
215 } 219 }
216 } 220 }
217 221
218 final String treatBlobAsVarBinary_prop = props.getProperty("treat_blob_as_binary"); 222 final String treatBlobAsVarBinary_prop = props.getProperty("treat_blob_as_binary");
219 if (treatBlobAsVarBinary_prop != null) { 223 if (treatBlobAsVarBinary_prop != null) {