KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > ejb > test > connection > FakeDataSource


1 //$Id: FakeDataSource.java,v 1.1 2005/07/15 00:07:03 epbernard Exp $
2
package org.hibernate.ejb.test.connection;
3
4 import java.sql.Connection JavaDoc;
5 import java.sql.SQLException JavaDoc;
6 import java.io.PrintWriter JavaDoc;
7 import javax.sql.DataSource JavaDoc;
8
9 /**
10  * @author Emmanuel Bernard
11  */

12 public class FakeDataSource implements DataSource JavaDoc {
13     public Connection JavaDoc getConnection() throws SQLException JavaDoc {
14         throw new FakeDataSourceException("connection");
15     }
16
17     public Connection JavaDoc getConnection(String JavaDoc username, String JavaDoc password) throws SQLException JavaDoc {
18         throw new FakeDataSourceException("connection with password");
19     }
20
21     public PrintWriter JavaDoc getLogWriter() throws SQLException JavaDoc {
22         throw new FakeDataSourceException("getLogWriter");
23     }
24
25     public void setLogWriter(PrintWriter JavaDoc out) throws SQLException JavaDoc {
26         throw new FakeDataSourceException("setLogWriter");
27     }
28
29     public void setLoginTimeout(int seconds) throws SQLException JavaDoc {
30         throw new FakeDataSourceException("setLoginTimeout");
31     }
32
33     public int getLoginTimeout() throws SQLException JavaDoc {
34         throw new FakeDataSourceException("getLoginTimeout");
35     }
36 }
37
Popular Tags