KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > web > mock > MockDataSource


1 package org.jboss.test.web.mock;
2
3 import java.io.PrintWriter JavaDoc;
4 import java.io.Serializable JavaDoc;
5 import java.sql.Connection JavaDoc;
6 import java.sql.SQLException JavaDoc;
7
8 import javax.sql.DataSource JavaDoc;
9
10 /**
11  * A noop DataSource implementation
12  *
13  * @author Scott.Stark@jboss.org
14  * @version $Revision:$
15  */

16 public class MockDataSource implements DataSource JavaDoc, Serializable JavaDoc
17 {
18    private static final long serialVersionUID = 1;
19
20    public MockDataSource()
21    {
22      System.err.println("MockDataSource");
23    }
24
25    public Connection JavaDoc getConnection() throws SQLException JavaDoc
26    {
27       return null;
28    }
29
30    public Connection JavaDoc getConnection(String JavaDoc arg0, String JavaDoc arg1) throws SQLException JavaDoc
31    {
32       return null;
33    }
34
35    public int getLoginTimeout() throws SQLException JavaDoc
36    {
37       return 0;
38    }
39
40    public PrintWriter JavaDoc getLogWriter() throws SQLException JavaDoc
41    {
42       return null;
43    }
44
45    public void setLoginTimeout(int arg0) throws SQLException JavaDoc
46    {
47       
48    }
49
50    public void setLogWriter(PrintWriter JavaDoc arg0) throws SQLException JavaDoc
51    {
52       
53    }
54
55 }
56
Popular Tags