View Javadoc
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  
18  import java.sql.Connection;
19  import java.sql.Driver;
20  import java.sql.DriverPropertyInfo;
21  import java.sql.SQLException;
22  import java.sql.SQLFeatureNotSupportedException;
23  import java.util.Properties;
24  import java.util.logging.Logger;
25  
26  public class DriverShim implements Driver {
27    private final Driver delegate;
28  
29    public DriverShim(Driver delegate) {
30      this.delegate = delegate;
31    }
32  
33    @Override
34    public Connection connect(String url, Properties info) throws SQLException {
35      return delegate.connect(url, info);
36    }
37  
38    @Override
39    public boolean acceptsURL(String url) throws SQLException {
40      return delegate.acceptsURL(url);
41    }
42  
43    @Override
44    public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws SQLException {
45      return delegate.getPropertyInfo(url, info);
46    }
47  
48    @Override
49    public int getMajorVersion() {
50      return delegate.getMajorVersion();
51    }
52  
53    @Override
54    public int getMinorVersion() {
55      return delegate.getMinorVersion();
56    }
57  
58    @Override
59    public boolean jdbcCompliant() {
60      return delegate.jdbcCompliant();
61    }
62  
63    @Override
64    public Logger getParentLogger() throws SQLFeatureNotSupportedException {
65      return delegate.getParentLogger();
66    }
67  }