Interface ConnectionSource

All Superinterfaces:
Component, org.apache.log4j.spi.OptionHandler
All Known Implementing Classes:
ConnectionSourceSkeleton, DataSourceConnectionSource, DriverManagerConnectionSource, JNDIConnectionSource

public interface ConnectionSource extends Component, org.apache.log4j.spi.OptionHandler
The ConnectionSource interface provides a pluggable means of transparently obtaining JDBC Connections for log4j classes that require the use of a Connection.
  • Field Details

  • Method Details

    • getConnection

      Connection getConnection() throws SQLException
      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
    • getSQLDialectCode

      int getSQLDialectCode()
      Get the SQL dialect that should be used for this connection. Note that the dialect is not needed if the JDBC driver supports the getGeneratedKeys method.
    • supportsGetGeneratedKeys

      boolean supportsGetGeneratedKeys()
      If the connection supports the JDBC 3.0 getGeneratedKeys method, then we do not need any specific dialect support.
    • supportsBatchUpdates

      boolean supportsBatchUpdates()
      If the connection does not support batch updates, we will avoid using them.