org.apache.avalon.excalibur.datasource
Class JdbcDataSource

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.avalon.excalibur.datasource.JdbcDataSource
All Implemented Interfaces:
Component, Configurable, DataSourceComponent, Disposable, Loggable, ThreadSafe

public class JdbcDataSource
extends AbstractLoggable
implements DataSourceComponent, Disposable

The Default implementation for DataSources in Avalon. This uses the normal java.sql.Connection object and java.sql.DriverManager.

Version:
CVS $Revision: 1.7 $ $Date: 2001/06/01 19:06:51 $
Author:
Berin Loritsch

Field Summary
protected  JdbcConnectionPool m_pool
           
 
Constructor Summary
JdbcDataSource()
           
 
Method Summary
 void configure(Configuration configuration)
          Configure and set up DB connection.
 void dispose()
          Dispose properly of the pool
 java.sql.Connection getConnection()
          Get the database connection
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_pool

protected JdbcConnectionPool m_pool
Constructor Detail

JdbcDataSource

public JdbcDataSource()
Method Detail

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Configure and set up DB connection. Here we set the connection information needed to create the Connection objects. It must be called only once.
Specified by:
configure in interface Configurable
Parameters:
conf - The Configuration object needed to describe the connection.
Throws:
ConfigurationException -  

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Get the database connection
Specified by:
getConnection in interface DataSourceComponent

dispose

public void dispose()
Dispose properly of the pool
Specified by:
dispose in interface Disposable


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.