jdbc-loopback: refuse connection if URL is unsupported v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Fri, 09 May 2014 14:16:45 +0200
branchv_0
changeset 1775cc7fdad1452
parent 176 9aa00e214020
child 178 5a5fc66f11b1
jdbc-loopback: refuse connection if URL is unsupported
java/jdbc-loopback-driver/src/info/globalcode/jdbc/loopback/Driver.java
     1.1 --- a/java/jdbc-loopback-driver/src/info/globalcode/jdbc/loopback/Driver.java	Sat Apr 12 20:01:42 2014 +0200
     1.2 +++ b/java/jdbc-loopback-driver/src/info/globalcode/jdbc/loopback/Driver.java	Fri May 09 14:16:45 2014 +0200
     1.3 @@ -43,7 +43,11 @@
     1.4  
     1.5  	@Override
     1.6  	public Connection connect(String url, Properties info) throws SQLException {
     1.7 -		return new Connection(url, info);
     1.8 +		if (acceptsURL(url)) {
     1.9 +			return new Connection(url, info);
    1.10 +		} else {
    1.11 +			throw new SQLException("Unsupported URL: " + url);
    1.12 +		}
    1.13  	}
    1.14  
    1.15  	@Override