public class DataSourceConnectionSource extends ConnectionSourceSkeleton implements org.apache.log4j.xml.UnrecognizedElementHandler
ConnectionSource
that obtains the Connection in the recommended JDBC manner based on
a DataSource
.
repository
HSQL_DIALECT, MSSQL_DIALECT, MYSQL_DIALECT, ORACLE_DIALECT, POSTGRES_DIALECT, UNKNOWN_DIALECT
Constructor and Description |
---|
DataSourceConnectionSource() |
Modifier and Type | Method and Description |
---|---|
void |
activateOptions() |
Connection |
getConnection()
Obtain a
Connection for use. |
DataSource |
getDataSource() |
boolean |
parseUnrecognizedElement(Element element,
Properties props) |
void |
setDataSource(DataSource dataSource) |
discoverConnnectionProperties, getOverriddenSupportsGetGeneratedKeys, getPassword, getSQLDialectCode, getUser, setOverriddenSupportsGetGeneratedKeys, setPassword, setUser, supportsBatchUpdates, supportsGetGeneratedKeys
getLogger, getLoggerRepository, getNonFloodingLogger, resetErrorCount, setLoggerRepository
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setLoggerRepository
public void activateOptions()
activateOptions
in interface org.apache.log4j.spi.OptionHandler
public Connection getConnection() throws SQLException
ConnectionSource
Connection
for use. The client is
responsible for closing the Connection
when it is no
longer required.getConnection
in interface ConnectionSource
SQLException
- if a Connection
could not be
obtainedConnectionSource.getConnection()
public DataSource getDataSource()
public void setDataSource(DataSource dataSource)
public boolean parseUnrecognizedElement(Element element, Properties props) throws Exception
parseUnrecognizedElement
in interface org.apache.log4j.xml.UnrecognizedElementHandler
Exception
Copyright © 2002-2017 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache Chainsaw, Chainsaw, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.