01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.geronimo.gjndi.binding;
17:
18: import org.apache.geronimo.gbean.GBeanInfo;
19: import org.apache.geronimo.gbean.GBeanInfoBuilder;
20:
21: import javax.sql.DataSource;
22: import java.io.PrintWriter;
23: import java.sql.Connection;
24: import java.sql.SQLException;
25:
26: /**
27: * @version $Rev$ $Date$
28: */
29: public class MockDataSource implements DataSource {
30: public Connection getConnection() throws SQLException {
31: return null;
32: }
33:
34: public Connection getConnection(String username, String password)
35: throws SQLException {
36: return null;
37: }
38:
39: public PrintWriter getLogWriter() throws SQLException {
40: return null;
41: }
42:
43: public void setLogWriter(PrintWriter out) throws SQLException {
44: }
45:
46: public void setLoginTimeout(int seconds) throws SQLException {
47: }
48:
49: public int getLoginTimeout() throws SQLException {
50: return 0;
51: }
52:
53: public boolean isWrapperFor(Class<?> iface) throws SQLException {
54: return false;
55: }
56:
57: public <T> T unwrap(Class<T> iface) throws SQLException {
58: return null;
59: }
60:
61: public static final GBeanInfo GBEAN_INFO;
62:
63: public static GBeanInfo getGBeanInfo() {
64: return MockDataSource.GBEAN_INFO;
65: }
66:
67: static {
68: GBeanInfoBuilder builder = GBeanInfoBuilder.createStatic(
69: MockDataSource.class, "MockDataSource");
70: GBEAN_INFO = builder.getBeanInfo();
71: }
72: }
|