ch.qos.logback.core.db
Class DriverManagerConnectionSource

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.db.ConnectionSourceBase
          extended by ch.qos.logback.core.db.DriverManagerConnectionSource
All Implemented Interfaces:
ConnectionSource, ContextAware, LifeCycle

public class DriverManagerConnectionSource
extends ConnectionSourceBase

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
DriverManagerConnectionSource()
           
 
Method Summary
 Connection getConnection()
          Obtain a Connection for use.
 String getDriverClass()
          Returns the name of the driver class.
 String getUrl()
          Returns the url.
 void setDriverClass(String driverClass)
          Sets the driver class.
 void setUrl(String url)
          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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DriverManagerConnectionSource

public DriverManagerConnectionSource()
Method Detail

start

public void start()
Specified by:
start in interface LifeCycle
Overrides:
start in class ConnectionSourceBase

getConnection

public Connection getConnection()
                         throws SQLException
Description copied from interface: ConnectionSource
Obtain a Connection for use. The client is responsible for closing the Connection when it is no longer required.

Throws:
SQLException - if a Connection could not be obtained
See Also:
ConnectionSource.getConnection()

getUrl

public String getUrl()
Returns the url.

Returns:
String

setUrl

public void setUrl(String url)
Sets the url.

Parameters:
url - The url to set

getDriverClass

public String getDriverClass()
Returns the name of the driver class.

Returns:
String

setDriverClass

public void setDriverClass(String driverClass)
Sets the driver class.

Parameters:
driverClass - The driver class to set


Copyright © 2005-2012 QOS.ch. All Rights Reserved.