org.apache.commons.scaffold.sql
Class MockAdaptor

java.lang.Object
  extended by org.apache.commons.scaffold.sql.ConnectionAdaptor
      extended by org.apache.commons.scaffold.sql.MockAdaptor

public class MockAdaptor
extends ConnectionAdaptor


Field Summary
 
Fields inherited from class org.apache.commons.scaffold.sql.ConnectionAdaptor
DATA_SOURCE_KEY, datasource, JNDI_CONTEXT_KEY, pool
 
Constructor Summary
MockAdaptor()
           
 
Method Summary
protected  DataSource getDataSource(String key)
          Return datasource using JNDI lookup.
 void setupDataSource(DataSource datasource)
          Set internal datasource field.
 
Methods inherited from class org.apache.commons.scaffold.sql.ConnectionAdaptor
getConnection, getConnection, getKey, getMessage, getPool, setKey, setMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockAdaptor

public MockAdaptor()
Method Detail

getDataSource

protected DataSource getDataSource(String key)
                            throws SQLException
Description copied from class: ConnectionAdaptor
Return datasource using JNDI lookup. Subclasses may override this method to provide other means of obtaining a datasource reference.

Overrides:
getDataSource in class ConnectionAdaptor
Parameters:
key - The attribute name for the resource. If null is passed, null is returned.
Returns:
null or the datasource object related to "key" TODO: Add cache to store references to the datasources by key.
Throws:
SQLException

setupDataSource

public void setupDataSource(DataSource datasource)
Set internal datasource field. Call once *before* getPool().



Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.