org.apache.log4j.db
Class DataSourceConnectionSource
java.lang.Object
org.apache.log4j.spi.ComponentBase
org.apache.log4j.db.ConnectionSourceSkeleton
org.apache.log4j.db.DataSourceConnectionSource
- All Implemented Interfaces:
- ConnectionSource, org.apache.log4j.spi.Component, org.apache.log4j.spi.OptionHandler, org.apache.log4j.xml.UnrecognizedElementHandler
public class DataSourceConnectionSource
- extends ConnectionSourceSkeleton
- implements org.apache.log4j.xml.UnrecognizedElementHandler
The DataSourceConnectionSource is an implementation of ConnectionSource
that obtains the Connection in the recommended JDBC manner based on
a DataSource.
- Author:
- Ray DeCampo, Ceki Gülcü
| Fields inherited from class org.apache.log4j.spi.ComponentBase |
repository |
| Methods inherited from class org.apache.log4j.spi.ComponentBase |
getLogger, getLoggerRepository, getNonFloodingLogger, resetErrorCount, setLoggerRepository |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.log4j.spi.Component |
setLoggerRepository |
DataSourceConnectionSource
public DataSourceConnectionSource()
activateOptions
public void activateOptions()
- Specified by:
activateOptions in interface org.apache.log4j.spi.OptionHandler
getConnection
public java.sql.Connection getConnection()
throws java.sql.SQLException
- Description copied from interface:
ConnectionSource
- Obtain a
Connection for use. The client is
responsible for closing the Connection when it is no
longer required.
- Specified by:
getConnection in interface ConnectionSource
- Throws:
java.sql.SQLException - if a Connection could not be
obtained- See Also:
ConnectionSource.getConnection()
getDataSource
public javax.sql.DataSource getDataSource()
setDataSource
public void setDataSource(javax.sql.DataSource dataSource)
parseUnrecognizedElement
public boolean parseUnrecognizedElement(org.w3c.dom.Element element,
java.util.Properties props)
throws java.lang.Exception
- Specified by:
parseUnrecognizedElement in interface org.apache.log4j.xml.UnrecognizedElementHandler
- Throws:
java.lang.Exception
Copyright © 2007 Apache Software Foundation. All Rights Reserved.