com.github.smokestack.jdbc
Class MockDataSource

java.lang.Object
  extended by com.github.smokestack.jdbc.MockDataSource
All Implemented Interfaces:
DataSource

public class MockDataSource
extends Object
implements DataSource

Author:
bbrag

Field Summary
static MockDataSource instance
          Public access to instance
 
Method Summary
 MockConnection _getConnection()
           
 MockConnection _getConnection(String username, String password)
           
 int _getLoginTimeout()
           
 PrintWriter _getLogWriter()
           
 void _setLoginTimeout(int seconds)
           
 void _setLogWriter(PrintWriter out)
           
 Connection getConnection()
           
 Connection getConnection(String username, String password)
           
static MockDataSource getInstance()
           
 int getLoginTimeout()
           
 PrintWriter getLogWriter()
           
 List<MockConnection> getMockConnections()
           
 void reset()
           
 void setLoginTimeout(int seconds)
           
 void setLogWriter(PrintWriter out)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

instance

public static final MockDataSource instance
Public access to instance

Method Detail

getInstance

public static MockDataSource getInstance()

getConnection

public Connection getConnection()
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

_getConnection

public MockConnection _getConnection()
                              throws SQLException
Throws:
SQLException

getConnection

public Connection getConnection(String username,
                                String password)
                         throws SQLException
Specified by:
getConnection in interface DataSource
Throws:
SQLException

_getConnection

public MockConnection _getConnection(String username,
                                     String password)
                              throws SQLException
Throws:
SQLException

getLogWriter

public PrintWriter getLogWriter()
                         throws SQLException
Specified by:
getLogWriter in interface DataSource
Throws:
SQLException

_getLogWriter

public PrintWriter _getLogWriter()
                          throws SQLException
Throws:
SQLException

getLoginTimeout

public int getLoginTimeout()
                    throws SQLException
Specified by:
getLoginTimeout in interface DataSource
Throws:
SQLException

_getLoginTimeout

public int _getLoginTimeout()
                     throws SQLException
Throws:
SQLException

setLogWriter

public void setLogWriter(PrintWriter out)
                  throws SQLException
Specified by:
setLogWriter in interface DataSource
Throws:
SQLException

_setLogWriter

public void _setLogWriter(PrintWriter out)
                   throws SQLException
Throws:
SQLException

setLoginTimeout

public void setLoginTimeout(int seconds)
                     throws SQLException
Specified by:
setLoginTimeout in interface DataSource
Throws:
SQLException

_setLoginTimeout

public void _setLoginTimeout(int seconds)
                      throws SQLException
Throws:
SQLException

getMockConnections

public List<MockConnection> getMockConnections()

reset

public void reset()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2010 Smokestack. All Rights Reserved.