org.nanocontainer.persistence.jdbc
Class DBCPDataSource

java.lang.Object
  extended by org.nanocontainer.persistence.jdbc.AbstractDataSource
      extended by org.nanocontainer.persistence.jdbc.DBCPDataSource
All Implemented Interfaces:
DataSource, org.picocontainer.Startable

public class DBCPDataSource
extends AbstractDataSource
implements org.picocontainer.Startable

Commons-DBCP DataSource component implementation. It has failover support.

Author:
Juze Peleteiro

Constructor Summary
DBCPDataSource(Properties properties)
           
DBCPDataSource(Properties properties, ExceptionHandler jdbcExceptionHandler)
           
DBCPDataSource(String driver, String connectionURL, String username, String password)
           
DBCPDataSource(String driver, String connectionURL, String username, String password, ExceptionHandler jdbcExceptionHandler)
           
 
Method Summary
protected  DataSource getDelegatedDataSource()
           
protected  void invalidateDelegatedDataSource()
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.nanocontainer.persistence.jdbc.AbstractDataSource
getConnection, getConnection, getLoginTimeout, getLogWriter, handleException, setLoginTimeout, setLogWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBCPDataSource

public DBCPDataSource(String driver,
                      String connectionURL,
                      String username,
                      String password)
Parameters:
driver - The driver classname.
connectionURL - The connection url.
username - The connection username.
password - The connection password.

DBCPDataSource

public DBCPDataSource(String driver,
                      String connectionURL,
                      String username,
                      String password,
                      ExceptionHandler jdbcExceptionHandler)
Parameters:
driver - The driver classname.
connectionURL - The connection url.
username - The connection username.
password - The connection password.
jdbcExceptionHandler - The ExceptionHandler component instance.

DBCPDataSource

public DBCPDataSource(Properties properties)
Parameters:
properties - DBCP properties. See at @{link http://jakarta.apache.org/commons/dbcp/configuration.html}

DBCPDataSource

public DBCPDataSource(Properties properties,
                      ExceptionHandler jdbcExceptionHandler)
Parameters:
properties - DBCP properties. See at @{link http://jakarta.apache.org/commons/dbcp/configuration.html}
jdbcExceptionHandler - The ExceptionHandler component instance.
Method Detail

getDelegatedDataSource

protected DataSource getDelegatedDataSource()
                                     throws Exception
Specified by:
getDelegatedDataSource in class AbstractDataSource
Throws:
Exception
See Also:
AbstractDataSource.getDelegatedDataSource()

invalidateDelegatedDataSource

protected void invalidateDelegatedDataSource()
                                      throws Exception
Specified by:
invalidateDelegatedDataSource in class AbstractDataSource
Throws:
Exception
See Also:
AbstractDataSource.invalidateDelegatedDataSource()

start

public void start()
Specified by:
start in interface org.picocontainer.Startable
See Also:
Startable.start()

stop

public void stop()
Specified by:
stop in interface org.picocontainer.Startable
See Also:
Startable.stop()


Copyright 2003-2003-2006 Codehaus. All Rights Reserved.