public class J2eeDataSource extends org.apache.avalon.framework.logger.AbstractLogEnabled implements DataSourceComponent
javax.sql.DataSource object and assumes that the
J2EE container pools the datasources properly.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
JDBC_NAME |
protected javax.sql.DataSource |
m_dataSource |
protected java.lang.String |
m_password |
protected java.lang.String |
m_user |
ROLE| Constructor and Description |
|---|
J2eeDataSource() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Configure and set up DB connection.
|
java.sql.Connection |
getConnection()
Get the database connection
|
public static final java.lang.String JDBC_NAME
protected javax.sql.DataSource m_dataSource
protected java.lang.String m_user
protected java.lang.String m_password
public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
configure in interface org.apache.avalon.framework.configuration.Configurableconf - The Configuration object needed to describe the
connection.org.apache.avalon.framework.configuration.ConfigurationExceptionpublic java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface DataSourceComponentNoValidConnectionException - when there is no valid Connection wrapper
available in the classloader.NoAvailableConnectionException - when there are no more available
Connections in the pool.java.sql.SQLException