1 28 package net.sf.jguard.ext.database; 29 30 import java.io.PrintWriter ; 31 import java.sql.Connection ; 32 import java.sql.SQLException ; 33 34 import javax.sql.DataSource ; 35 36 import net.sf.jguard.ext.database.ConnectionFactory; 37 38 public class MockdataSource implements DataSource { 39 40 private ConnectionFactory connFactory; 41 42 public MockdataSource(ConnectionFactory connFactory) { 43 this.connFactory = connFactory; 44 } 45 46 public Connection getConnection() throws SQLException { 47 return connFactory.getConnection(); 48 } 49 50 public Connection getConnection(String username, String password) 51 throws SQLException { 52 return null; 53 } 54 55 public PrintWriter getLogWriter() throws SQLException { 56 return null; 57 } 58 59 public void setLogWriter(PrintWriter out) throws SQLException { 60 61 } 62 63 public void setLoginTimeout(int seconds) throws SQLException { 64 65 } 66 67 public int getLoginTimeout() throws SQLException { 68 return 0; 69 } 70 71 } 72 | Popular Tags |