KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > gjndi > binding > MockDataSource


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * 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  */

17 package org.apache.geronimo.gjndi.binding;
18
19 import org.apache.geronimo.gbean.GBeanInfo;
20 import org.apache.geronimo.gbean.GBeanInfoBuilder;
21
22 import javax.sql.DataSource JavaDoc;
23 import java.io.PrintWriter JavaDoc;
24 import java.sql.Connection JavaDoc;
25 import java.sql.SQLException JavaDoc;
26
27 /**
28  * @version $Rev$ $Date$
29  */

30 public class MockDataSource implements DataSource JavaDoc {
31     public Connection JavaDoc getConnection() throws SQLException JavaDoc {
32         return null;
33     }
34
35     public Connection JavaDoc getConnection(String JavaDoc username, String JavaDoc password) throws SQLException JavaDoc {
36         return null;
37     }
38
39     public PrintWriter JavaDoc getLogWriter() throws SQLException JavaDoc {
40         return null;
41     }
42
43     public void setLogWriter(PrintWriter JavaDoc out) throws SQLException JavaDoc {
44     }
45
46     public void setLoginTimeout(int seconds) throws SQLException JavaDoc {
47     }
48
49     public int getLoginTimeout() throws SQLException JavaDoc {
50         return 0;
51     }
52
53     public static final GBeanInfo GBEAN_INFO;
54
55     public static GBeanInfo getGBeanInfo() {
56         return MockDataSource.GBEAN_INFO;
57     }
58
59     static {
60         GBeanInfoBuilder builder = GBeanInfoBuilder.createStatic(MockDataSource.class, "MockDataSource");
61         GBEAN_INFO = builder.getBeanInfo();
62     }
63 }
64
Popular Tags