Changeset: 27b7166860c8 for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=27b7166860c8
Modified Files:
        src/main/java/nl/cwi/monetdb/jdbc/MonetDriver.java.in
Branch: default
Log Message:

According to the JDBC specification if the JDBC URL is invalid, return null 
instead of an exception, so the DriverManager can keep looking for a suitable 
JDBC driver.


diffs (27 lines):

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
@@ -116,7 +116,7 @@ final public class MonetDriver implement
        {
                // url should be of style jdbc:monetdb://<host>/<database>
                if (!acceptsURL(url))
-                       throw new SQLNonTransientConnectionException("Invalid 
URL: it does not start with: " + MONETURL, "08M26");
+                       return null;
 
                Properties props = new Properties();
                // set the optional properties and their defaults here
@@ -134,12 +134,12 @@ final public class MonetDriver implement
                try {
                        uri = new URI(url.substring(5));
                } catch (URISyntaxException e) {
-                       throw new 
SQLNonTransientConnectionException(e.toString(), "08M26");
+                       return null;
                }
 
                String uri_host = uri.getHost();
                if (uri_host == null)
-                       throw new SQLNonTransientConnectionException("Invalid 
URL: no hostname given or unparsable in '" + url + "'", "08M26");
+                       return null;
                info.put("host", uri_host);
 
                int uri_port = uri.getPort();
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to