There is a box in the admin console under
Resources --> JDBC-Provider --> MyProvider --> DataSources --> MyDataSource
Thanks.
CMP is defined at the bean level. You configure it for each EJB through
deployment descriptors or annotations.
See below script. This is a series of actions which enables the CMP
checkbox, there is no simple boolean parameter we can change.
adapterPath = jdbcScope + 'J2CResourceAdapter:WebSphere
Relational Resource Adapter/'
adapter = AdminConfig.getid(adapterPath)
cfName = dsName + '_CF'
cfPath = adapterPath + 'CMPConnectorFactory:' +
cfName
cf = AdminConfig.getid(cfPath)
if (cf != ""):
AdminConfig.remove(cf)
#end if
nameAttr = ['name', cfName]
authMechanism = ['authMechanismPreference',
'BASIC_PASSWORD']
dsAttr = ['cmpDatasource', dsId]
jndiNameAttr = ['jndiName', 'eis/' + dsJNDIName +
'_CMP']
authDataAliasAttr = ['authDataAlias',
dsContainerManagedAuthAlias]
cfAttrs = [nameAttr, authMechanism, dsAttr,
jndiNameAttr, authDataAliasAttr]
cf =
AdminConfig.create('CMPConnectorFactory', adapter, cfAttrs)
where
jdbcScope is the scope string
jdbcId is the id of the datasouce
dsName is the name of the datasource
dsJNDIName is the jndi name of the datasource
dsContainerManagedAuthAlias is the auth alias name
-Ravi Thoutam.