Interface DataAcc
- All Known Implementing Classes:
DataHub
public interface DataAcc
Provides access to named
DataConn data connection instances.
This interface defines the contract for retrieving managed data connections registered under
specific names within a data access scope (such as a DataHub). Application business logic
uses this interface to obtain connection objects required to perform database or external service
operations.
-
Method Summary
Modifier and TypeMethodDescription<C extends DataConn>
CgetDataConn(String name, Class<C> cls) Retrieves a data connection associated with the specified data source name and casts it to the requested connection class type.
-
Method Details
-
getDataConn
Retrieves a data connection associated with the specified data source name and casts it to the requested connection class type.If a connection for the given
namehas already been created within the current transaction or execution scope, that connection instance is returned. Otherwise, a new connection is created via the corresponding registered data source.- Type Parameters:
C- the expected type ofDataConn- Parameters:
name- the registered logical name of the data sourcecls- theClassrepresenting the target connection typeC- Returns:
- the data connection instance associated with the specified name
- Throws:
com.github.sttk.errs.Err- if no data source with the specified name is found, if creating the connection fails or yields null, or if the connection cannot be cast to the target type
-