Class DataSourceConnectionSource

  • All Implemented Interfaces:
    ConnectionSource, ContextAware, LifeCycle

    public class DataSourceConnectionSource
    extends ConnectionSourceBase
    The DataSourceConnectionSource is an implementation of 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 Detail

      • DataSourceConnectionSource

        public DataSourceConnectionSource()
    • Method Detail

      • getConnection

        public java.sql.Connection getConnection()
                                          throws java.sql.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:
        java.sql.SQLException - if a Connection could not be obtained
        See Also:
        ConnectionSource.getConnection()
      • getDataSource

        public javax.sql.DataSource getDataSource()
      • setDataSource

        public void setDataSource​(javax.sql.DataSource dataSource)