Products | Versions |
---|---|
TIBCO BusinessEvents Enterprise Edition | - |
Not Applicable | - |
Resolution:
Description:
============
How to access shared jdbc connection resource from a custom Java function to access BusinessEvents Connection pool.
The purpose of this solution is to get access to the Database connection pool created by BE engine, from a custom Java class.
Environment:
==========
TIBCO BusinessEvents: ALL
Operating System: ALL
Resolution:
==========
Scenario:
If a business requirement needs you to make database calls in the custom Java class and not to expose the user credentials, you can use the sharedjdbc connection resource to access database by enabling DBConcepts in the Cluster Deployment Descriptor(CDD) file.
A Database connection pool is created on BE engine startup, when the backingstore or DBconcepts is enabled in the CDD file. DBConcepts has to be enabled at Processing Unit level.
In order to get the connection from connection pool created for DBConcepts, use the following code in the custom Java functions.
Connection conn = DBConnectionFactory.getInstance().getConnectionPoolManager().getJDBCConnection(sharedresourceURI);