Interface ConnectionInterceptor

All Known Implementing Classes:
StdConnectionInterceptor

public interface ConnectionInterceptor
An interceptor for managing connections to dataSource. Used internally by Higson for getting/releasing connection. Defined by HyperonEngineFactory, and used within MiniJdbcTemplate. Each connection to database, that was established getConnection(DataSource) and used, should be released afterwards releaseConnection(Connection). Created by psikora on 2017-01-18.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    getConnection(@NotNull DataSource dataSource)
    Attempts to establish a connection with the given dataSource.
    void
    Close the given connection that was established to DataSource.
  • Method Details

    • getConnection

      Connection getConnection(@NotNull @NotNull DataSource dataSource) throws SQLException
      Attempts to establish a connection with the given dataSource.
      Parameters:
      dataSource - data source for which connection should be established. Can't be null.
      Returns:
      a connection to the data source
      Throws:
      SQLException - if a database access error occurs
    • releaseConnection

      void releaseConnection(Connection connection)
      Close the given connection that was established to DataSource.
      Parameters:
      connection - Connection to close. If null, then nothing happens
      See Also: