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 theJdbcAppenderbut 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 java.sql.ConnectiongetConnection()This should return a new connection every time it is called.java.lang.StringtoString()All implementations must overrideObject.toString()to provide information about the connection configuration (obscuring passwords with one-way hashes).
-
-
-
Method Detail
-
getConnection
java.sql.Connection getConnection() throws java.sql.SQLExceptionThis should return a new connection every time it is called.- Returns:
- the SQL connection object.
- Throws:
java.sql.SQLException- if a database error occurs.
-
toString
java.lang.String toString()
All implementations must overrideObject.toString()to provide information about the connection configuration (obscuring passwords with one-way hashes).- Overrides:
toStringin classjava.lang.Object- Returns:
- the string representation of this connection source.
-
-