Package com.ohalee.database.api
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 TypeMethodDescriptionvoidconnect()Initializes the connection to the database.voidCloses 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
Gets the underlying connection object.- Returns:
- the connection object.
- Throws:
Exception- if an error occurs
-