Package ch.qos.logback.core.db
Class DataSourceConnectionSource
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.db.ConnectionSourceBase
-
- ch.qos.logback.core.db.DataSourceConnectionSource
-
- All Implemented Interfaces:
ConnectionSource
,ContextAware
,LifeCycle
public class DataSourceConnectionSource extends ConnectionSourceBase
The DataSourceConnectionSource is an implementation ofConnectionSource
that obtains the Connection in the recommended JDBC manner based on aDataSource
.For more information about this component, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#DBAppender
-
-
Constructor Summary
Constructors Constructor Description DataSourceConnectionSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connection
getConnection()
Obtain aConnection
for use.DataSource
getDataSource()
void
setDataSource(DataSource dataSource)
void
start()
-
Methods inherited from class ch.qos.logback.core.db.ConnectionSourceBase
discoverConnectionProperties, getPassword, getSQLDialectCode, getUser, isStarted, setPassword, setUser, stop, supportsBatchUpdates, supportsGetGeneratedKeys
-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getStatusManager, setContext
-
-
-
-
Method Detail
-
start
public void start()
- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classConnectionSourceBase
-
getConnection
public Connection getConnection() throws SQLException
Description copied from interface:ConnectionSource
Obtain aConnection
for use. The client is responsible for closing theConnection
when it is no longer required.- Throws:
SQLException
- if aConnection
could not be obtained- See Also:
ConnectionSource.getConnection()
-
getDataSource
public DataSource getDataSource()
-
setDataSource
public void setDataSource(DataSource dataSource)
-
-