Class StaticConnectionProvider

java.lang.Object
org.tquadrat.foundation.sql.StaticConnectionProvider
All Implemented Interfaces:
ConnectionProvider

@ClassVersion(sourceVersion="$Id: StaticConnectionProvider.java 1075 2023-10-02 12:37:07Z tquadrat $") @API(status=STABLE, since="0.1.0") public final class StaticConnectionProvider extends Object implements ConnectionProvider

An implementation of ConnectionProvider that returns always the same Connection instance.

This connection provider should not be used for production purposes! It will not allow the connection to be closed, the database session remains open for its whole lifetime. In addition, it is by no means thread-safe!

It can be used for testing purposes, or when the database access is needed for a very short period of.

Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: StaticConnectionProvider.java 1075 2023-10-02 12:37:07Z tquadrat $
Since:
0.1.0
UML Diagram
UML Diagram for "org.tquadrat.foundation.sql.StaticConnectionProvider"

UML Diagram for "org.tquadrat.foundation.sql.StaticConnectionProvider"

UML Diagram for "org.tquadrat.foundation.sql.StaticConnectionProvider"
  • Field Details

  • Constructor Details

    • StaticConnectionProvider

      Creates a new instance of StaticConnectionProvider.

      The provided connection must be open and valid, although this will not be checked here.

      Parameters:
      connection - The connection that is returned by each call to
  • Method Details