public class DriverManagerConnectionSource extends ConnectionSourceBase
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
Constructor and Description |
---|
DriverManagerConnectionSource() |
Modifier and Type | Method and Description |
---|---|
java.sql.Connection |
getConnection()
Obtain a
Connection for use. |
java.lang.String |
getDriverClass()
Returns the name of the driver class.
|
java.lang.String |
getUrl()
Returns the url.
|
void |
setDriverClass(java.lang.String driverClass)
Sets the driver class.
|
void |
setUrl(java.lang.String url)
Sets the url.
|
void |
start() |
discoverConnectionProperties, getPassword, getSQLDialectCode, getUser, isStarted, setPassword, setUser, stop, supportsBatchUpdates, supportsGetGeneratedKeys
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getStatusManager, setContext
public void start()
start
in interface LifeCycle
start
in class ConnectionSourceBase
public java.sql.Connection getConnection() throws java.sql.SQLException
ConnectionSource
Connection
for use. The client is
responsible for closing the Connection
when it is no
longer required.java.sql.SQLException
- if a Connection
could not be
obtainedConnectionSource.getConnection()
public java.lang.String getUrl()
public void setUrl(java.lang.String url)
url
- The url to setpublic java.lang.String getDriverClass()
public void setDriverClass(java.lang.String driverClass)
driverClass
- The driver class to setCopyright © 2010 - 2020 Adobe. All Rights Reserved