# HG changeset patch # User František Kučera # Date 1551198701 -3600 # Node ID 8ce612cca4d88a1c49b742cc8fc130adb243a0ae # Parent 3058712548389ef8079f8d43c7e63a45e0ca25bb JDBC drivers: fix 'Unsupported URL' – drivers might be called witrh wrong URLs and then they should (according to the JavaDoc) return null instead of throwing an exception. This problem occurred when --test-connection was testing multiple connections in parallel. diff -r 305871254838 -r 8ce612cca4d8 java/jdbc-dk-driver/src/info/globalcode/sql/dk/jdbc/Driver.java --- a/java/jdbc-dk-driver/src/info/globalcode/sql/dk/jdbc/Driver.java Tue Feb 26 16:36:45 2019 +0100 +++ b/java/jdbc-dk-driver/src/info/globalcode/sql/dk/jdbc/Driver.java Tue Feb 26 17:31:41 2019 +0100 @@ -86,7 +86,8 @@ throw new SQLException("Unable to load SQL-DK configuration for name: " + name, e); } } else { - throw new SQLException("Unsupported URL: " + url); + // The driver should return "null" if it realizes it is the wrong kind of driver to connect to the given URL. + return null; } } diff -r 305871254838 -r 8ce612cca4d8 java/jdbc-loopback-driver/src/info/globalcode/jdbc/loopback/Driver.java --- a/java/jdbc-loopback-driver/src/info/globalcode/jdbc/loopback/Driver.java Tue Feb 26 16:36:45 2019 +0100 +++ b/java/jdbc-loopback-driver/src/info/globalcode/jdbc/loopback/Driver.java Tue Feb 26 17:31:41 2019 +0100 @@ -46,7 +46,8 @@ if (acceptsURL(url)) { return new Connection(url, info); } else { - throw new SQLException("Unsupported URL: " + url); + // The driver should return "null" if it realizes it is the wrong kind of driver to connect to the given URL. + return null; } }