public class DataSourceConnectionSource extends ConnectionSourceBase
ConnectionSource that obtains the Connection in the recommended JDBC
manner based on a DataSource.
For more information about this component, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#DBAppender
| Constructor and Description |
|---|
DataSourceConnectionSource() |
| Modifier and Type | Method and Description |
|---|---|
Connection |
getConnection()
Obtain a
Connection for use. |
DataSource |
getDataSource() |
void |
setDataSource(DataSource dataSource) |
void |
start() |
discoverConnectionProperties, getPassword, getSQLDialectCode, getUser, isStarted, setPassword, setUser, stop, supportsBatchUpdates, supportsGetGeneratedKeyspublic void start()
start in interface ch.qos.logback.core.spi.LifeCyclestart in class ConnectionSourceBasepublic Connection getConnection() throws SQLException
ConnectionSourceConnection for use. The client is
responsible for closing the Connection when it is no
longer required.SQLException - if a Connection could not be
obtainedConnectionSource.getConnection()public DataSource getDataSource()
public void setDataSource(DataSource dataSource)
Copyright © 2005–2022 QOS.ch. All rights reserved.