Interface ConnectionSource
-
- All Superinterfaces:
LifeCycle
- All Known Implementing Classes:
AbstractConnectionSource
,AbstractDriverManagerConnectionSource
,DataSourceConnectionSource
,DriverManagerConnectionSource
,FactoryMethodConnectionSource
public interface ConnectionSource extends LifeCycle
Configuration element forJdbcAppender
. If you want to use theJdbcAppender
but none of the provided connection sources meet your needs, you can simply create your own connection source.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Connection
getConnection()
This should return a new connection every time it is called.String
toString()
All implementations must overrideObject.toString()
to provide information about the connection configuration (obscuring passwords with one-way hashes).
-
-
-
Method Detail
-
getConnection
Connection getConnection() throws SQLException
This should return a new connection every time it is called.- Returns:
- the SQL connection object.
- Throws:
SQLException
- if a database error occurs.
-
toString
String toString()
All implementations must overrideObject.toString()
to provide information about the connection configuration (obscuring passwords with one-way hashes).
-
-