Interface DatabaseProvider<T>

Type Parameters:
T - The type of the underlying connection or client.

public interface DatabaseProvider<T>
Interface defining the lifecycle and contract for a database provider.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Initializes the connection to the database.
    void
    Closes the connection to the database.
    Gets the underlying connection object.
  • Method Details

    • connect

      void connect()
      Initializes the connection to the database. Implementations should ensure this method is idempotent.
    • disconnect

      void disconnect()
      Closes the connection to the database. Should handle closing of pools and resources.
    • getConnection

      T getConnection() throws Exception
      Gets the underlying connection object.
      Returns:
      the connection object.
      Throws:
      Exception - if an error occurs