1 package org.hibernate.ejb.test.connection; 3 4 import java.sql.Connection ; 5 import java.sql.SQLException ; 6 import java.io.PrintWriter ; 7 import javax.sql.DataSource ; 8 9 12 public class FakeDataSource implements DataSource { 13 public Connection getConnection() throws SQLException { 14 throw new FakeDataSourceException("connection"); 15 } 16 17 public Connection getConnection(String username, String password) throws SQLException { 18 throw new FakeDataSourceException("connection with password"); 19 } 20 21 public PrintWriter getLogWriter() throws SQLException { 22 throw new FakeDataSourceException("getLogWriter"); 23 } 24 25 public void setLogWriter(PrintWriter out) throws SQLException { 26 throw new FakeDataSourceException("setLogWriter"); 27 } 28 29 public void setLoginTimeout(int seconds) throws SQLException { 30 throw new FakeDataSourceException("setLoginTimeout"); 31 } 32 33 public int getLoginTimeout() throws SQLException { 34 throw new FakeDataSourceException("getLoginTimeout"); 35 } 36 } 37 | Popular Tags |