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 TypeMethodDescriptionReturns a JDBC connection from the underlying HikariCP pool.voidinit()Initializes the connection pool by loading HikariCP configuration.booleanReturns whether this connection is configured to cause server shutdown on initialization failure.voidshutdown()Shuts down the HikariCP connection pool and releases all associated resources.
-
Method Details
-
getConnection
Returns a JDBC connection from the underlying HikariCP pool.- Returns:
- a
Connectionfrom the pool - Throws:
RuntimeException- wrappingSQLExceptionif the connection cannot be obtained
-
init
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:
trueif the server should exit when this connection fails to initialize
-