01: package net.sourceforge.jdbclogger.core;
02:
03: /*
04: * Licensed to the Apache Software Foundation (ASF) under one or more
05: * contributor license agreements. See the NOTICE file distributed with
06: * this work for additional information regarding copyright ownership.
07: * The ASF licenses this file to You under the Apache License, Version 2.0
08: * (the "License"); you may not use this file except in compliance with
09: * the License. You may obtain a copy of the License at
10: *
11: * http://www.apache.org/licenses/LICENSE-2.0
12: *
13: * Unless required by applicable law or agreed to in writing, software
14: * distributed under the License is distributed on an "AS IS" BASIS,
15: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16: * See the License for the specific language governing permissions and
17: * limitations under the License.
18: */
19: import java.sql.Connection;
20: import java.sql.Driver;
21: import java.sql.DriverPropertyInfo;
22: import java.sql.SQLException;
23: import java.util.ArrayList;
24: import java.util.List;
25: import java.util.Properties;
26:
27: /**
28: * @author Martin Marinschek (latest modification by $Author: catalean $)
29: * @version $Revision: 83 $ $Date: 2007-07-07 14:00:58 -0700 (Sat, 07 Jul 2007) $
30: */
31: public abstract class AbstractWrapperDriver implements Driver {
32: protected Driver _driver;
33: protected List formatters;
34:
35: public AbstractWrapperDriver() {
36: formatters = new ArrayList();
37: }
38:
39: public Driver getDriver() {
40: return _driver;
41: }
42:
43: public void setDriver(Driver driver) {
44: _driver = driver;
45: }
46:
47: public boolean acceptsURL(String s) throws SQLException {
48: return _driver.acceptsURL(s);
49: }
50:
51: public int getMajorVersion() {
52: return _driver.getMajorVersion();
53: }
54:
55: public int getMinorVersion() {
56: return _driver.getMinorVersion();
57: }
58:
59: public DriverPropertyInfo[] getPropertyInfo(String s,
60: Properties properties) throws SQLException {
61: return _driver.getPropertyInfo(s, properties);
62: }
63:
64: public boolean jdbcCompliant() {
65: return _driver.jdbcCompliant();
66: }
67:
68: public abstract Connection connect(String s, Properties properties)
69: throws SQLException;
70:
71: /**
72: * @return the formatters
73: */
74: public List getFormatters() {
75: return formatters;
76: }
77:
78: /**
79: * @param formatters the formatters to set
80: */
81: public void setFormatters(List formatters) {
82: this.formatters = formatters;
83: }
84: }
|