org.apache.avalon.excalibur.datasource
Class J2eeDataSource
java.lang.Object
|
+--org.apache.avalon.framework.logger.AbstractLogEnabled
|
+--org.apache.avalon.excalibur.datasource.J2eeDataSource
- All Implemented Interfaces:
- Component, Configurable, DataSourceComponent, LogEnabled, ThreadSafe
- public class J2eeDataSource
- extends AbstractLogEnabled
- implements DataSourceComponent
The J2EE implementation for DataSources in Cocoon. This uses the
javax.sql.DataSource
object and assumes that the
J2EE container pools the datasources properly.
- Since:
- 4.0
- Version:
- CVS $Revision: 1.13 $ $Date: 2003/05/20 20:44:43 $
- Author:
- Berin Loritsch
- Avalon Component:
- Avalon Service:
- type=DataSourceComponent
- Avalon Component Information:
- name=j2ee-datasource
- Avalon Component Lifestyle:
- type=singleton
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JDBC_NAME
public static final String JDBC_NAME
- See Also:
- Constant Field Values
m_dataSource
protected DataSource m_dataSource
m_user
protected String m_user
m_password
protected String m_password
J2eeDataSource
public J2eeDataSource()
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
- Throws:
ConfigurationException
getConnection
public Connection getConnection()
throws SQLException
- Get the database connection
- Specified by:
getConnection
in interface DataSourceComponent
- Returns:
- Connection a valid connection for you to use
SQLException
Copyright © 2000-2003 Apache Avalon Project. All Rights Reserved.