1 // 2 // ======================================================================== 3 // Copyright (c) 1995-2012 Mort Bay Consulting Pty. Ltd. 4 // ------------------------------------------------------------------------ 5 // All rights reserved. This program and the accompanying materials 6 // are made available under the terms of the Eclipse Public License v1.0 7 // and Apache License v2.0 which accompanies this distribution. 8 // 9 // The Eclipse Public License is available at 10 // http://www.eclipse.org/legal/epl-v10.html 11 // 12 // The Apache License v2.0 is available at 13 // http://www.opensource.org/licenses/apache2.0.php 14 // 15 // You may elect to redistribute this code under either of these licenses. 16 // ======================================================================== 17 // 18 19 package com.acme; 20 21 import java.io.PrintWriter; 22 import java.sql.Connection; 23 import java.sql.SQLException; 24 import java.util.logging.Logger; 25 26 import javax.sql.DataSource; 27 28 /** 29 * MockDataSource 30 * 31 * 32 */ 33 public class MockDataSource implements DataSource 34 { 35 36 /** 37 * NOTE: JDK7+ new feature 38 */ 39 public Logger getParentLogger() 40 { 41 // TODO Auto-generated method stub 42 return null; 43 } 44 45 /** 46 * @see javax.sql.DataSource#getConnection() 47 */ 48 public Connection getConnection() throws SQLException 49 { 50 // TODO Auto-generated method stub 51 return null; 52 } 53 54 /** 55 * @see javax.sql.DataSource#getConnection(java.lang.String, java.lang.String) 56 */ 57 public Connection getConnection(String username, String password) 58 throws SQLException 59 { 60 // TODO Auto-generated method stub 61 return null; 62 } 63 64 /** 65 * @see javax.sql.DataSource#getLogWriter() 66 */ 67 public PrintWriter getLogWriter() throws SQLException 68 { 69 // TODO Auto-generated method stub 70 return null; 71 } 72 73 /** 74 * @see javax.sql.DataSource#getLoginTimeout() 75 */ 76 public int getLoginTimeout() throws SQLException 77 { 78 // TODO Auto-generated method stub 79 return 0; 80 } 81 82 /** 83 * @see javax.sql.DataSource#setLogWriter(java.io.PrintWriter) 84 */ 85 public void setLogWriter(PrintWriter out) throws SQLException 86 { 87 // TODO Auto-generated method stub 88 89 } 90 91 /** 92 * @see javax.sql.DataSource#setLoginTimeout(int) 93 */ 94 public void setLoginTimeout(int seconds) throws SQLException 95 { 96 // TODO Auto-generated method stub 97 98 } 99 100 public boolean isWrapperFor(Class<?> iface) throws SQLException 101 { 102 // TODO Auto-generated method stub 103 return false; 104 } 105 106 public <T> T unwrap(Class<T> iface) throws SQLException 107 { 108 // TODO Auto-generated method stub 109 return null; 110 } 111 112 }