DriverShim.java

  1. /*
  2.  *    Copyright 2010-2022 the original author or authors.
  3.  *
  4.  *    Licensed under the Apache License, Version 2.0 (the "License");
  5.  *    you may not use this file except in compliance with the License.
  6.  *    You may obtain a copy of the License at
  7.  *
  8.  *       https://www.apache.org/licenses/LICENSE-2.0
  9.  *
  10.  *    Unless required by applicable law or agreed to in writing, software
  11.  *    distributed under the License is distributed on an "AS IS" BASIS,
  12.  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13.  *    See the License for the specific language governing permissions and
  14.  *    limitations under the License.
  15.  */
  16. package org.apache.ibatis.migration.driver;

  17. import java.sql.Connection;
  18. import java.sql.Driver;
  19. import java.sql.DriverPropertyInfo;
  20. import java.sql.SQLException;
  21. import java.sql.SQLFeatureNotSupportedException;
  22. import java.util.Properties;
  23. import java.util.logging.Logger;

  24. public class DriverShim implements Driver {
  25.   private final Driver delegate;

  26.   public DriverShim(Driver delegate) {
  27.     this.delegate = delegate;
  28.   }

  29.   @Override
  30.   public Connection connect(String url, Properties info) throws SQLException {
  31.     return delegate.connect(url, info);
  32.   }

  33.   @Override
  34.   public boolean acceptsURL(String url) throws SQLException {
  35.     return delegate.acceptsURL(url);
  36.   }

  37.   @Override
  38.   public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
  39.     return delegate.getPropertyInfo(url, info);
  40.   }

  41.   @Override
  42.   public int getMajorVersion() {
  43.     return delegate.getMajorVersion();
  44.   }

  45.   @Override
  46.   public int getMinorVersion() {
  47.     return delegate.getMinorVersion();
  48.   }

  49.   @Override
  50.   public boolean jdbcCompliant() {
  51.     return delegate.jdbcCompliant();
  52.   }

  53.   @Override
  54.   public Logger getParentLogger() throws SQLFeatureNotSupportedException {
  55.     return delegate.getParentLogger();
  56.   }
  57. }