KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > jdbclogger > core > AbstractWrapperDriver


1 package net.sourceforge.jdbclogger.core;
2 /*
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 import java.sql.Connection JavaDoc;
19 import java.sql.Driver JavaDoc;
20 import java.sql.DriverPropertyInfo JavaDoc;
21 import java.sql.SQLException JavaDoc;
22 import java.util.ArrayList JavaDoc;
23 import java.util.List JavaDoc;
24 import java.util.Properties JavaDoc;
25
26 /**
27  * @author Martin Marinschek (latest modification by $Author: catalean $)
28  * @version $Revision: 83 $ $Date: 2007-07-08 00:00:58 +0300 (Sun, 08 Jul 2007) $
29  */

30 public abstract class AbstractWrapperDriver implements Driver JavaDoc
31 {
32     protected Driver JavaDoc _driver;
33     protected List JavaDoc formatters;
34
35     public AbstractWrapperDriver()
36     {
37         formatters = new ArrayList JavaDoc();
38     }
39
40     public Driver JavaDoc getDriver()
41     {
42         return _driver;
43     }
44
45     public void setDriver(Driver JavaDoc driver)
46     {
47         _driver = driver;
48     }
49
50     public boolean acceptsURL(String JavaDoc s) throws SQLException JavaDoc
51     {
52         return _driver.acceptsURL(s);
53     }
54
55     public int getMajorVersion()
56     {
57         return _driver.getMajorVersion();
58     }
59
60     public int getMinorVersion()
61     {
62         return _driver.getMinorVersion();
63     }
64
65     public DriverPropertyInfo JavaDoc[] getPropertyInfo(String JavaDoc s, Properties JavaDoc properties) throws SQLException JavaDoc
66     {
67         return _driver.getPropertyInfo(s, properties);
68     }
69
70     public boolean jdbcCompliant()
71     {
72         return _driver.jdbcCompliant();
73     }
74        
75     public abstract Connection JavaDoc connect(String JavaDoc s, Properties JavaDoc properties) throws SQLException JavaDoc;
76
77     /**
78      * @return the formatters
79      */

80     public List JavaDoc getFormatters() {
81         return formatters;
82     }
83
84     /**
85      * @param formatters the formatters to set
86      */

87     public void setFormatters(List JavaDoc formatters) {
88         this.formatters = formatters;
89     }
90 }
91
Popular Tags