Changeset: d7added7aaf3 for monetdb-java
URL: http://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=d7added7aaf3
Modified Files:
        src/main/java/nl/cwi/monetdb/jdbc/MonetConnection.java
        src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java.in
Branch: embedded
Log Message:

Small fixes for the JDBC embedded connection: proper error display and port 
removal.


diffs (38 lines):

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);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to