diff --git a/mockdriver/src/main/java/org/jaydebeapi/mockdriver/MockDriver.java b/mockdriver/src/main/java/org/jaydebeapi/mockdriver/MockDriver.java index a17b903..d3c00ea 100644 --- a/mockdriver/src/main/java/org/jaydebeapi/mockdriver/MockDriver.java +++ b/mockdriver/src/main/java/org/jaydebeapi/mockdriver/MockDriver.java @@ -5,53 +5,59 @@ import java.sql.Driver; import java.sql.DriverManager; import java.sql.DriverPropertyInfo; import java.sql.SQLException; +import java.sql.SQLFeatureNotSupportedException; import java.util.Properties; +import java.util.logging.Logger; import org.mockito.Mockito; public class MockDriver implements Driver { - static { - MockDriver driver = new MockDriver(); - try { - DriverManager.registerDriver(driver); - } catch (SQLException e) { - throw new RuntimeException(e); - } - } + static { + MockDriver driver = new MockDriver(); + try { + DriverManager.registerDriver(driver); + } catch (SQLException e) { + throw new RuntimeException(e); + } + } - @Override - public Connection connect(String url, Properties info) throws SQLException { - if (!url.startsWith("jdbc:jaydebeapi://")) { - return null; - } - return Mockito.mock(Connection.class); - } + @Override + public Connection connect(String url, Properties info) throws SQLException { + if (!url.startsWith("jdbc:jaydebeapi://")) { + return null; + } + return Mockito.mock(Connection.class); + } - @Override - public boolean acceptsURL(String url) throws SQLException { - return true; - } + @Override + public boolean acceptsURL(String url) throws SQLException { + return true; + } - @Override - public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) - throws SQLException { - return null; - } + @Override + public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) + throws SQLException { + return null; + } - @Override - public int getMajorVersion() { - return 0; - } + @Override + public int getMajorVersion() { + return 0; + } - @Override - public int getMinorVersion() { - return 0; - } + @Override + public int getMinorVersion() { + return 0; + } - @Override - public boolean jdbcCompliant() { - return false; - } + @Override + public boolean jdbcCompliant() { + return false; + } + + public Logger getParentLogger() throws SQLFeatureNotSupportedException { + throw new SQLFeatureNotSupportedException("Not supported by this driver."); + } }