Package ch.qos.logback.core.db
Class DriverManagerConnectionSource
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.db.ConnectionSourceBase
ch.qos.logback.core.db.DriverManagerConnectionSource
- All Implemented Interfaces:
ConnectionSource
,ContextAware
,LifeCycle
The DriverManagerConnectionSource is an implementation of
ConnectionSource
that obtains the Connection in the traditional JDBC
manner based on the connection URL.
For more information about this component, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#DBAppender
- Author:
- Ray DeCampo
-
Field Summary
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObtain aConnection
for use.Returns the name of the driver class.getUrl()
Returns the url.void
setDriverClass(String driverClass)
Sets the driver class.void
Sets the url.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, getDeclaredOrigin, getStatusManager, setContext
-
Constructor Details
-
DriverManagerConnectionSource
public DriverManagerConnectionSource()
-
-
Method Details
-
start
public void start()- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classConnectionSourceBase
-
getConnection
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()
-
getUrl
Returns the url.- Returns:
- String
-
setUrl
Sets the url.- Parameters:
url
- The url to set
-
getDriverClass
Returns the name of the driver class.- Returns:
- String
-
setDriverClass
Sets the driver class.- Parameters:
driverClass
- The driver class to set
-