# HG changeset patch # User Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> # Date 1485353057 -3600 # Node ID d7added7aaf3c92084659bdc9781c79ca68878ad # Parent 8af0a7387b4ee9dfb80433fc9e5d4e6098442334 Small fixes for the JDBC embedded connection: proper error display and port removal. diff --git a/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java b/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java --- a/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java +++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java @@ -1672,10 +1672,12 @@ public abstract class MonetConnection ex SQLException ret = null; String[] errors = error.split("\n"); for (String error1 : errors) { + String error2 = isEmbedded() ? error1 : error1.substring(0, 5); + String error3 = isEmbedded() ? "M0M10" : error1.substring(6); if (ret == null) { - ret = new SQLException(error1.substring(6), error1.substring(0, 5)); + ret = new SQLException(error2, error3); } else { - ret.setNextException(new SQLException(error1.substring(6), error1.substring(0, 5))); + ret.setNextException(new SQLException(error2, error3)); } } throw ret; diff --git a/src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java.in b/src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java.in --- a/src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java.in +++ b/src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java.in @@ -364,7 +364,6 @@ final public class MonetDriver implement public Connection connect(String url, Properties info) throws SQLException { int tmp; Properties props = new Properties(); - props.put("port", PORT); props.putAll(info); info = props; @@ -461,7 +460,7 @@ final public class MonetDriver implement boolean negative1 = false, failedparse1 = false; int port = 0; try { - port = Integer.parseInt(props.getProperty("port")); + port = Integer.parseInt(props.getProperty("port", PORT)); } catch (NumberFormatException e) { failedparse1 = true; props.setProperty("port", PORT);