diff -r a3ec71fa8e17 -r 7e08730da258 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 18:19:49 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/** - * SQL-DK - * Copyright © 2014 František Kučera (frantovo.cz) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package info.globalcode.jdbc.loopback; - -import java.sql.DriverManager; -import java.sql.DriverPropertyInfo; -import java.sql.SQLException; -import java.sql.SQLFeatureNotSupportedException; -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - * @author Ing. František Kučera (frantovo.cz) - */ -public class Driver implements java.sql.Driver { - - private static final Logger log = Logger.getLogger(Driver.class.getName()); - - static { - try { - DriverManager.registerDriver(new Driver()); - } catch (SQLException e) { - log.log(Level.SEVERE, "Unable to register JDBC driver", e); - } - } - - @Override - public Connection connect(String url, Properties info) throws SQLException { - if (acceptsURL(url)) { - return new Connection(url, info); - } else { - // The driver should return "null" if it realizes it is the wrong kind of driver to connect to the given URL. - return null; - } - } - - @Override - public boolean acceptsURL(String url) throws SQLException { - return url != null && url.startsWith("jdbc:loopback://"); - } - - @Override - public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException { - return new DriverPropertyInfo[0]; - } - - @Override - public int getMajorVersion() { - return 0; - } - - @Override - public int getMinorVersion() { - return 1; - } - - @Override - public boolean jdbcCompliant() { - return false; - } - - @Override - public Logger getParentLogger() throws SQLFeatureNotSupportedException { - throw new SQLFeatureNotSupportedException("Not supported yet."); - } - -}