class PooledDataSourceProvider extends java.lang.Object implements DataSourceProvider
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Map<java.lang.String,java.lang.reflect.Method> |
cpdsSetters
A collection of setters for a ComboPooledDataSource
|
private static CentralLogger |
LOG
Logger
|
private static PooledDataSourceProvider |
pdsp
The PooledDataSourceProvider instance.
|
| Modifier | Constructor and Description |
|---|---|
private |
PooledDataSourceProvider()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
javax.sql.DataSource |
getDataSource(Database database,
DatabaseConfig cfg)
Obtain the
DataSource for a specific Database. |
javax.sql.DataSource |
getDataSource(Database database,
DatabaseConfig cfg,
java.lang.String tenantId)
Obtain the
DataSource for a specific Database. |
static PooledDataSourceProvider |
getInstance()
Return the instance of
PooledDataSourceProvider. |
private java.lang.String |
setDatabaseConnectionSettingsTenant(com.mchange.v2.c3p0.ComboPooledDataSource ds,
java.lang.String tenantId,
java.lang.String pdbName)
Given a
DataSource, set its URL, username and password, based on the given tenant
and database combination. |
private static java.util.Map<java.lang.String,java.lang.reflect.Method> cpdsSetters
private static final CentralLogger LOG
private static final PooledDataSourceProvider pdsp
public static PooledDataSourceProvider getInstance()
PooledDataSourceProvider.public javax.sql.DataSource getDataSource(Database database, DatabaseConfig cfg) throws PersistenceException
DataSource for a specific Database.getDataSource in interface DataSourceProviderdatabase - The FWD database that needs a connection to backing database.cfg - The configuration for the given database.DataSource for the specified database.PersistenceException - If any error occurs in the process.public javax.sql.DataSource getDataSource(Database database, DatabaseConfig cfg, java.lang.String tenantId) throws PersistenceException
DataSource for a specific Database.database - The FWD database that needs a connection to backing database.cfg - The configuration for the given database.tenantId - The id of the tenant.DataSource for the specified database.PersistenceException - If any error occurs in the process.private java.lang.String setDatabaseConnectionSettingsTenant(com.mchange.v2.c3p0.ComboPooledDataSource ds,
java.lang.String tenantId,
java.lang.String pdbName)
DataSource, set its URL, username and password, based on the given tenant
and database combination.ds - The given data source.tenantId - The id of the tenant.pdbName - The physical database name.