Interface DatabaseConnection

All Known Implementing Classes:
DatabaseConnectionImpl

public interface DatabaseConnection
Represents a managed database connection backed by HikariCP.

Connections are configured via .properties files referenced by the CONNECTOR_DB_<ID>_CONFIG environment variable. The properties format follows the HikariCP configuration specification.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a JDBC connection from the underlying HikariCP pool.
    void
    Initializes the connection pool by loading HikariCP configuration.
    boolean
    Returns whether this connection is configured to cause server shutdown on initialization failure.
    void
    Shuts down the HikariCP connection pool and releases all associated resources.
  • Method Details

    • getConnection

      @NotNull @NotNull Connection getConnection()
      Returns a JDBC connection from the underlying HikariCP pool.
      Returns:
      a Connection from the pool
      Throws:
      RuntimeException - wrapping SQLException if the connection cannot be obtained
    • init

      void init() throws ConnectionInitException
      Initializes the connection pool by loading HikariCP configuration.
      Throws:
      ConnectionInitException - if the configuration is invalid or the pool cannot be created
    • shutdown

      void shutdown()
      Shuts down the HikariCP connection pool and releases all associated resources.
    • isExitOnFailure

      boolean isExitOnFailure()
      Returns whether this connection is configured to cause server shutdown on initialization failure.
      Returns:
      true if the server should exit when this connection fails to initialize